Displaying 1 result from an estimated 1 matches for "levelidata".
Did you mean:
devel&data
2011 Aug 25
2
within-groups variance and between-groups variance
...e[[1]])
levels <- levels(groupvariable2)
numlevels <- length(levels)
# get the mean and standard deviation for each group:
numtotal <- 0
denomtotal <- 0
for (i in 1:numlevels)
{
leveli <- levels[i]
levelidata <- variable[groupvariable==leveli,]
levelilength <- length(levelidata)
# get the mean and standard deviation for group i:
meani <- mean(levelidata)
sdi <- sd(levelidata)
numi <- (levelilength - 1)*(sdi * sdi)
den...