#install.packages("pwr") library(pwr) 谿 <- 2 譴ク谿 <- 5 蟆 <- 0.8 power.t.test(delta = 谿, sd = 譴ク谿, power = 蟆, type = 'paired')
> power.t.test(delta = 谿, sd = 譴ク谿, power = 蟆, type = 'paired') Paired t test power calculation n = 51.00957 delta = 2 sd = 5 sig.level = 0.05 power = 0.8 alternative = two.sided NOTE: n is number of *pairs*, sd is std.dev. of *differences* within pairs
蠏碁9 <- 3 蠏碁9螳覿 <- 3 蠏碁9企 <- 2 蟆 <- 0.8 power.anova.test(groups = 蠏碁9, between.var = 蠏碁9螳覿, within.var = 蠏碁9企, power = 蟆)
> power.anova.test(groups = 蠏碁9, between.var = 蠏碁9螳覿, within.var = 蠏碁9企, power = 蟆) Balanced one-way analysis of variance power calculation groups = 3 n = 4.38143 between.var = 3 within.var = 2 sig.level = 0.05 power = 0.8 NOTE: n is number in each group
蠏碁91 <- 0.25 蠏碁92 <- 0.5 蟆 <- 0.8 power.prop.test(p1 = 蠏碁91, p2 = 蠏碁92, power = 蟆)
> power.prop.test(p1 = 蠏碁91, p2 = 蠏碁92, power = 蟆) Two-sample comparison of proportions power calculation n = 57.67344 p1 = 0.25 p2 = 0.5 sig.level = 0.05 power = 0.8 alternative = two.sided NOTE: n is number in *each* group
m1 <- 25 #蠏碁91 蠏 sd1 <-5 #蠏碁91 譴ク谿 n1 <- 20 #蠏碁91 覲語 m2 <- 31 #蠏碁92 蠏 sd2 <-5 #蠏碁92 譴ク谿 n2 <- 21 #蠏碁92 覲語 d <- abs((m1 - m2) / sqrt(((n1-1) * sd1^ 2 + (n2-1) * sd2^2) / (n1 + n2 - 2))) d #螻狩蠍 pwr.t.test(d=d,power=.8,sig.level=.05,type="two.sample",alternative="two.sided")
> pwr.t.test(d=d,power=.8,sig.level=.05,type="two.sample",alternative="two.sided") Two-sample t test power calculation n = 11.94226 d = 1.2 sig.level = 0.05 power = 0.8 alternative = two.sided NOTE: n is number in *each* group