[R] effect size
Peter B. Mandeville
mandevip at uaslp.mx
Tue Mar 16 23:40:38 CET 2004
ETA2 <- function(lm.obj){
cat("\n ETA2:\n\n")
tmp <- anova(lm.obj)
print(round(tmp$'Sum Sq'/sum(tmp$'Sum Sq'),4))
}
At 10:58 p.m. 16/03/04 +0100, you wrote:
>Prof Brian Ripley wrote:
>
>>I think you want to call summary.lm on the aov object, but this depends
>>on what you mean by `effect size'.
>>
>>
>I guess this is what we wanted.
>
>>Given that, I wonder if you are used to standard terminology.
>>
>No, I am not, unfortunately. We are doing lots of statistical analyses,
>using R because it is fab and such, but reviewers are looking for SPSS
>output using terminology that we can't find in the R bundle---but our
>general impression is that R does things way more cleverer and better than
>click-until-you-seed-red-signifficant-effect tools found elsewhere.
>Reactions on r-help caused us to request for a better specification of the
>`effect size' that people wanted, and it turns out to be
>$$ SS(effect) / \Sum SS $$ (SS being sums-of-squares). To me, a simple
>physicist, that sounds as `the fraction of explained variance' by the
>factor. Looking at the formulas in help(summary.lm) is seems that
>summary.lm()$r.squared is exactly what we want (for a one-way aov).
>
>Is there a way to quickly tabulate the expression $$ SS(effect) /
>(\Sum_{effects} SS(effect) + SS(residuals)) $$ ?
>
>The numbers are practically there in the summary.aov() table. Only the
>grand total SS needs to be calculated.
>
>>For example, R does have an effects() function, and that might be what
>>you want.
>>
>>
>I don't really understand the effects()---it must be related to
>coefficients() but it obviously is different. There is model.tables.aov()
>which is also enlightening, but I think it is really the $ r^2 $ that we
>were looking for (our reviewers calling this an $ \eta^2 $---if that
>clarifies things).
>
>Thanks,
>
>---david
>
>>On Mon, 15 Mar 2004, David A. van Leeuwen wrote:
>>
>>
>>
>>>Having searched google '[R] aov effect size' without any results I
>>>wonder if I not completely miss something.
>>>Is there any R function that calculates the effect size of an AOV's main
>>>effect or interaction effect? It should be related to the F's and the
>>>degree of freedom of the error, but the multitude in numbers in aov()
>>>baffle me a bit.
>>>
>
>______________________________________________
>R-help at stat.math.ethz.ch mailing list
>https://www.stat.math.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
More information about the R-help
mailing list