[Rd] noncentrality paramter in power.anova.test (PR#7244)

From: <meyerjp_at_jmu.edu>
Date: Fri 24 Sep 2004 - 05:27:09 EST


Full_Name:
Version: 1.9.0
OS: Windows XP
Submission from: (NULL) (134.126.93.191)

I believe the noncentrality parameter, lambda, in power.anova.test is incorrect. The noncentrality paramter is defined as lambda <- (groups - 1) * n * (between.var/within.var). The n should not be there. The function pf defines the noncentrality parameter as the sum of squares of the means. Therefore, the noncentrality paramter, lambda, in power.anova.test should be lambda <- (groups - 1) * (between.var/within.var). The following code shows the difference in results. I've compared a few power computations using the new lambda to values from a text on power. The new lambda produces more correct values for power.

groups <- 3
n <- 5
between.var <- 10.295
within.var <- 1
sig.level <- 0.05

#The first, incorrect lambda is used in power.anova.test
#incorrect labmda

lambda <- (groups - 1) * n * (between.var/within.var) pf(qf(sig.level, groups - 1, (n - 1) * groups, lower = FALSE),

            groups - 1, (n - 1) * groups, lambda, lower = FALSE)

#This correct lambda should be used instead
lambda <- (groups - 1) * (between.var/within.var) pf(qf(sig.level, groups - 1, (n - 1) * groups, lower = FALSE),

                      groups - 1, (n - 1) * groups, lambda, lower = FALSE)



R-devel@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Fri Sep 24 05:31:34 2004

This archive was generated by hypermail 2.1.8 : Fri 18 Mar 2005 - 09:00:22 EST