Please show detailed R-code. Choose an inferential test of interest (ANOVA) and show using R code that its statistical power is greater for alpha = 0.05 than for alpha = 0.001.
Solution:
I choose left-tailed t-test
Ho : mu = 28
Ha: mu < 28
#power t-test left-tailed test
n <- 50
df <- n-1
s <- 5.6
xbar <- 25.9
t1 = qt(0.95 , df)
mu0 <- 28
rejectValue1 <- mu0 - t1 * s/sqrt(n)
rejectValue1
mu <- 22:27
power1 <- pt( (rejectValue1 -mu) /(s/sqrt(n)) , df)
plot(mu,power1, type="l", col="red" )
t2 = qt(0.999 , df)
mu0 <- 28
rejectValue2 <- mu0 - t2 * s/sqrt(n)
rejectValue2
mu <- 22:27
power2 <- pt( (rejectValue2 -mu) /(s/sqrt(n)) , df)
par(new=TRUE)
plot(mu,power2, type="l", col="green" )
red is when alpha = 0.05
green when alpha = 0.001
statistical power is greater for alpha = 0.05 than for alpha = 0.001
Get Answers For Free
Most questions answered within 1 hours.