Power statistic

284 Views Asked by At

The rainfall in acre-feet from 20 clouds that were selected at random and seeded with silver nitrate follows: 18.0, 30.7, 19.8, 27.1, 22.3, 18.8, 31.8, 23.4, 21.2, 27.9, 31.9, 27.1, 25.0, 24.7, 26.9, 21.8, 29.2, 34.8, 26.7, and 31.6.

(a) Can you support a claim that mean rainfall from seeded clouds exceeds 25 acre-feet? Use α = 0.01. Find the P-value.

b)Compute the power of the test if the true mean rainfall is 27 acre-feet?

c) What sample size would be required to detect a true mean rainfall of 27.5 acre-feet if you wanted the power of the test to be at least 0.9?

I think I got question A down, but I am not so sure about B and C

My attempt for question B in R:

x<-c(18.0, 30.7, 19.8, 27.1, 22.3, 18.8, 31.8, 23.4, 21.2, 27.9, 31.9, 27.1, 25.0, 24.7, 26.9, 21.8, 29.2, 34.8, 26.7, 31.6)

n<-length(x)

s<-sd(x)

alpha<-0.01

mu0<-25

mu<-27

pwr.t.test(n , d = (mu-mu0)/s , sig.level = 0.01,NULL , type = c("one.sample") , alternative = c("greater"))

One-sample t test power calculation 

          n = 20
          d = 0.4179934
  sig.level = 0.01
      power = 0.2780838
alternative = greater

I am not sure if my power calculation is right. Any ideas?

1

There are 1 best solutions below

0
On

Yes, the power you obtained is correct. The critical value for the test $$H_0 : \mu = \mu_0 = 25 \quad \text{vs.} \quad H_a : \mu > \mu_0$$ for $n = 20$ and $\alpha = 0.01$ is $$t_{n-1,\alpha}^* = t_{19,0.01}^* = 2.53948,$$ meaning that $H_0$ will be rejected in favor of $H_a$ if the test statistic $$T = \frac{\bar X - \mu_0}{s/\sqrt{n}} > 2.53948.$$ Then, under the alternative $$H_1 : \mu = \mu_1 = 27,$$ this test has power $$1 - \Pr[T' \le t_{n-1,\alpha}^*],$$ where $$T' \sim \operatorname{NoncentralStudentT}\left(\nu = n-1 = 19, \lambda = \frac{\mu_1 - \mu_0}{s/\sqrt{n}} = 1.86932\right)$$ is the noncentral student $t$ distribution with $\nu$ degrees of freedom and noncentrality parameter $\lambda$.


For the sample size calculation, the low power of the test indicates that the data's variability (specifically, $s$ is large relative to $\mu_1 - \mu_0$, or equivalently, Cohen's $d$ is large) requires a much larger sample size than $n = 20$ to have a test with at least $90\%$ power. Thus, a normal approximation is justified (large degrees of freedom), and we can proceed with a sample size calculation based on the normal distribution for a one-sided test: $$n \ge s^2 \left(\frac{z_{\alpha}^* + z_{\beta}^*}{\mu_1 - \mu_0}\right)^2 = 74.5024$$ where $z_\alpha^* = 2.32635$ and $z_\beta^* = 1.28155$ are the $99^{\rm th}$ and $90^{\rm th}$ percentiles of the standard normal, so $n \ge 76$.

But when we plug $n = 76$ into the power calculation, we get $89.5\%$ power. The precise lower bound is $n \ge 78$, found by trial and error starting with $76$ and computing $\lambda$ and $t_{n-1,\alpha}^*$.