With summary do this

my.summary<-function(x) c(mean(x),var(x))

summary(v1~V, fun=my.summary,data=df)
summary(v2~V, fun=my.summary,data=df)
summary(v3~V, fun=my.summary,data=df)
summary(v4~V, fun=my.summary,data=df)
summary(v5~V, fun=my.summary,data=df)

If you want you get the mean of all variable together in all table

my.summary<-function(x) 
c(mean(x[,1]),mean(x[,2]),mean(x[,3]),mean(x[,4]),mean(x[,5]))
summary(cbind(v1,v2,v3,v4,v5)~v,data=df)

 Justin BEM
BP 1917 Yaoundé
Tél (237) 76043774




________________________________
De : effeesse <scarpin...@gmail.com>
À : r-help@r-project.org
Envoyé le : Lun 13 décembre 2010, 15h 14min 22s
Objet : Re: [R] Re :  descriptive statistics


I am sorry, but I cannot understand how to use the "summary" function. Maybe,
if I describe my needs, you could sketch a line that could work.
In the data set variable "V" can take values 1 to 14. For the subgroup of
individuals where "V" takes value =1 I want the mean and variance of a
certain set of other variables (V1, V2, V3, V4, V5). And this for all the
other subgroups for values 2 to 14.
What do you suggest?
-- 
View this message in context: 
http://r.789695.n4.nabble.com/descriptive-statistics-tp3085197p3085462.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.



      
        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to