> -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 varian
#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
Hello,
I have been looking for functions for calculating the within-groups
variance and between-groups variance, for the case where you have
several numerical variables describing samples from a number of groups.
I didn't find such functions in R, so wrote my own versions myself (see
below). I ca
3 matches
Mail list logo