Hello there,

 

when using the function numSummary in Rcmdr and selecting more than one
variable (without grouping), the grand mean across all variables is returned
for each variable instead of the mean of each single variable. However, this
happens only for the mean, and not for sd, quantiles and na.

 

This is the output:

 

> numSummary(dataset1 [,c("var1", "var2")], 

+   statistics=c("mean", "sd", "quantiles"), quantiles=c(0,.25,.5,.75,1))

            mean       sd  0%  25% 50% 75% 100%  n NA

var1     15.58491 4.154637 10  14  15 19.5   28 54  0

var2     15.58491 5.904053  5  10  15 18.5   30 52  2

 

 

When using a grouping variable, everything is fine:

 

 

> numSummary(dataset1 [,c("var1", "var2")], 

+   groups= dataset1$gender, statistics=c("mean", "sd", "quantiles"), 

+   quantiles=c(0,.25,.5,.75,1))

 

Variable: var1

           mean       sd 0% 25% 50% 75% 100%  n NA

male   16.57895 4.634602 10  14  16  20   28 19  0

female 16.28571 3.937538 10  14  15  18   28 35  0

 

Variable: var2

           mean       sd 0% 25% 50%  75% 100%  n NA

male   14.72222 5.442810  8  10  14 15.0   28 18  1

female 14.76471 6.213664  5  10  15 19.5   30 34  1

 

 

 

Any ideas how to get separate means for multiple variables in numSummary
without grouping?

 

I am using R 2.14.0 and Rcmdr 1.7.2 on Windows 7 Professional.

 

Thanks in advance!

 

Boris

 

 


	[[alternative HTML version deleted]]

