prove if one sample t test accept null hypothesis then one sample sign test must accept the null hypothesis

117 Views Asked by At

Can I say, for a small sample size, if one sample t-test accepts the null hypothesis then one sample sign test must accept the null hypothesis as well? And the mean given is equal to the median given. the null hypothesis is the mean(median) of sample equal to the mean(median) given.

1

There are 1 best solutions below

3
On BEST ANSWER

No. The tests are not equivalent.

All that is necessary is to find a normal sample for which the t test rejects and the sign test does not, or a normal sample for which the sign test rejects and the t test does not. We consider right-sided alternatives: $H_0: \mu = 0$ vs $H_a: \mu > 0.$ [Here $\mu$ denotes the mean or median.]

Among 100,000 randomly generated standard normal samples of size $n = 13$ the following program finds 2490 samples for which only the t test rejects at the 5% level and 1985 samples for which only the sign test rejects at the 5% (actually, 4.6%) level.

As expected, the t test rejects in very nearly 5% of the samples (5040). In general, because of the discreteness of the binomial distribution, a sign test cannot have exactly a 5% significance level. The sample size $n = 13$ was chosen because $S \sim \mathsf{Binom}(13, 1/2)$ has $P(S \ge 10) = 0.0461 \approx 0.05.$ Using this criterion, the sign test rejected (at the 4.6% level) in 4535 of the 100,000 samples tested.

m = 10^5;  n = 13;  pv.s = pv.t = numeric(m)
for (i in 1:m) {
  x = rnorm(n);  s = sum(x > 0)
  pv.t[i] = t.test(x, alt="g")$p.value
  pv.s[i] = sum(dbinom(s:13, 13, .5))  }
mean((pv.t < .05) & (pv.s > .05))      
## 0.0249                  # fraction of samples where t test rejects but not sign test
mean((pv.t > .05) * (pv.s < .05))
## 0.01985                 # fraction of samples where sign test rejects but not t 
mean(pv.t < .05)
## 0.0504                  # fraction of samples where t test rejects
mean(pv.s < .05)
## 0.04535                 # fraction of samples where sign test rejects

Note: This question illustrates the danger of trying one test first and then using the other if the first does not reject. Then the true significance level of the combination of both tests is about 7%, not 5%.

mean((pv.t < .05) | (pv.s < .05))
## 0.07025                 # fraction of samples where at least one test rejects

Addendum (in response to Comment): Rounded to three places, here is as a sample x for which the t test rejects ($T = 2.362 > 1.782),$ but the sign test does not (number of positive elements $S = 9 < 10).$ However, finding just one such sample does not show the t test to be more powerful.

-0.988  0.393  2.117  1.841 -0.206  1.553  0.220  0.747 -0.197  0.373  0.734 -0.162  1.332

For a solid demonstration that the t test is more powerful than the sign test: (a) Pick an alternative value $\mu_a > \mu_0$ and a sample size $n.$ (b) Use the non-central t distribution to find the probability of rejecting if the data are from a population centered at $\mu_a.$ [In R, the functions pt and qt include the non-central t; use the third parameter.] (c) Use a simple binomial computation to show that the power of the sign test has smaller power (smaller probability of rejecting if data are from a population centered at $\mu_a.)$

You could also get close to the exact power values with a simulation, but doing the exact math would be best. Also, it is best to deal with normal data because there may be some non-normal populations for which the sign test is more powerful then the t test.

Addendum (on the power of the t test): As I mentioned in a Comment, the exact computation of the power of the t test requires the noncentral t distribution. We seek the power of the t test for testing $H_0: \mu = 0$ against $H_a: \mu = 1$ at the 5% level. With $n = 13$ observations from $\mathsf{Norm}(\mu_a = 1, \sigma = 1),$ the noncentrality parameter ncp is $\delta = \sqrt{n}(\mu_0-\mu_a)/\sigma = \sqrt{13}(1)/(1) = \sqrt{13} = 3.605551.$

To find the probability of rejection we want $P(T > c),$ where the $T$-statistic has a noncentral t distribution with 12 df, and noncentrality parameter $\delta$ as above, and $c = 1.782288$ cuts 5% of the probability from the upper tail of the (regular) t distribution with 12 df. In R we find the power to be 0.960.

1 - pt(qt(.95, 12), 12, sqrt(13))
## 0.9597032

A simulation gives essentially the same result:

m = 10^6;  n = 13
pv.t = replicate(m, t.test(rnorm(n,1,1), alt="g")$p.value)
mean(pv.t <= .05) 
## 0.959472

Below is a 'power curve' showing power values for various alternatives $\mu_a.$ The power for $\mu_a = 1$ is emphasized with red dotted lines. The only point of the curve that is not a power value is at $(0, .05),$ where the rejection probability is the significance level 5% of the test.

mu.a=seq(0, 1.5, by=.01); mu.0=0; sg = 1;  n = 13
ncp = sqrt(n)*(mu.a - mu.0)/sg
pwr = 1 - pt(qt(.95, n-1), n-1, ncp)

plot(mu.a, pwr, ylim=c(0,1), type="l", lwd=2, col="blue", 
    main="Power Curve of a One-Sided t Test")
  abline(v = 0, col="green2");  abline(h = 0, col="green2")
  abline(h = 1, col="green2");  abline(h = .05, col="purple")
  abline(v = 1.0, col="red", lty="dotted"); abline(h = .962, col="red", lty="dotted")

enter image description here