[R] numerical summaries across variables.

rajclinasia raj at clinasia.com
Tue Sep 1 08:17:07 CEST 2009


Hi Every one,
I have a dataframe "class" with "name", "sex", "age", "height", "Weight".
if i caluclate summary statistics with the below code

numSummary(class[,c("Height", "Weight")], groups=class$Name,
statistics=c("mean", "sd", "quantiles"), quantiles=c(0,
  .25,.5,.75,1))

iam getting output like this

Variable: Height 
        mean sd   0%  25%  50%  75% 100% n
Alfred  69.0 NA 69.0 69.0 69.0 69.0 69.0 1
Alice   56.5 NA 56.5 56.5 56.5 56.5 56.5 1
Barbara 65.3 NA 65.3 65.3 65.3 65.3 65.3 1
Carol   62.8 NA 62.8 62.8 62.8 62.8 62.8 1

Variable: Weight 
         mean sd    0%   25%   50%   75%  100% n
Alfred  112.5 NA 112.5 112.5 112.5 112.5 112.5 1
Alice    84.0 NA  84.0  84.0  84.0  84.0  84.0 1
Barbara  98.0 NA  98.0  98.0  98.0  98.0  98.0 1
Carol   102.5 NA 102.5 102.5 102.5 102.5 102.5 1

now my question is i want output like this 

                      height         weight
Alfred mean 
         sd    
         0%   
         25%   
         50%   
         75%  
         100% 
          n
Alice mean 
         sd    
         0%   
         25%   
         50%   
         75%  
         100% 
          n
Barbara mean 
         sd    
         0%   
         25%   
         50%   
         75%  
         100% 
          n

 it is nothing but a numerical summaries across varibales. is it possible.

Thanks in Advance.


-- 
View this message in context: http://www.nabble.com/numerical-summaries-across-variables.-tp25234915p25234915.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list