I'm still rather stunned, I have to admit ... there’s no simple and easy way to calculate & eta; or & eta; 2 in R... Therefore, I wrote a function on the Wikipedia page . Here:
eta <- function(x, squared = FALSE, ...) {
stopifnot(is.list(x))
y <- unlist(x)
mg <- rapply(x, mean, ...)
ng <- rapply(x, length, ...)
mtot <- mean(y, ...)
ssb <- sum(ng * (mg - mtot) ^ 2)
sst <- sum((y - mtot) ^ 2)
if (squared) {
res <- ssb/sst
} else {
res <- sqrt(ssb/sst)
}
return(res)
}
So, this gives another question, which I am going to publish in the near future ... what do you use to check linearity? However, I cannot calculate the p-values, so if anyone knows how to do this ... please let me know!
aL3xa source
share