You are testing H0: µ1 - µ 2 = 0 vs H1: µ1 - µ2 ≠ 0. In doing so, you are choosing n1 observations from population 1, and n2 observations from population 2. Keeping the same total N = 100 = n1 + n2, compute the power of the test to detect a difference of 0.6, with a population standard deviation of 1.0 when: n1 = 0.1×n2, n1 = 0.2×n2, n1 = 0.3×n2, …, n1 = 1.0×n2, n1 = 2×n2, n1 = 3×n2, … n1 = 10×n2.
n1=91, 83 ,77, 71, 67, 62 ,59, 56, 53, 50, 33, 25, 20, 17, 14 ,12, 11, 10 , 9
n2=9, 17, 23, 29, 33, 38, 41, 44, 47, 50, 67, 75, 80, 83, 86, 88, 89, 90, 91
Power=0.4042, 0.6156, 0.7140, 0.7771, 0.8055, 0.8295, 0.8392,
0.8457, 0.8496, 0.8508,
0.8055, 0.7383, 0.6700, 0.6156, 0.5485, 0.4960, 0.4671, 0.4365,
0.4042
R code:
x=c(1:10*0.1,2:10)
n1=round(100/(x+1),0)
n2=100-n1
t=1:length(x)*0
p=1:length(x)*0
for(i in 1:length(x))
{
t[i]=0.6/sqrt(1/n1[i]+1/n2[i])
p[i]=2-pnorm(1.96-t[i])-pnorm(1.96+t[i])
}
round(p,4)
Get Answers For Free
Most questions answered within 1 hours.