> -Original Message-
> From: r-help-boun...@r-project.org
> [mailto:r-help-boun...@r-project.org] On Behalf Of Coghlan, Avril
> Sent: 25 August 2011 16:02
> To: r-help@r-project.org
> Cc: Coghlan, Avril
> Subject: [R] within-groups variance and between-groups variance
>
> Hello,
>
> I ha
#Here is I think an easier way of coding all the components you need.
#The within-group variances, you get with this function:
apply(iris[,1:4],2,function(x) tapply(x,iris$Species,var))
#You can get what you computed by taking the column means.
apply(apply(iris[,1:4],2,function(x) tapply(x,iri
2 matches
Mail list logo