Hypothesis testing, is this method correct?

81 Views Asked by At

The fat-level in the liver of 12 subjects are measured before and after drinking 4 beers / day for a month. Före = before, Efter =after.

enter image description here

Assume normal distribution and test the hypothesis that alcohol consumption does not change fat-levels on the significance level 1%.

My attempt:

Before: $x_i \in N(\mu_i, \sigma)$

After: $y_i \in N(\mu_i + \Delta, \sigma)$

Let $$z_i = y_i - x_i \in N(\Delta, \sigma_z)$$ From the table we get the observations of $z_i$ by subtracting: $$0.25\quad 0.09\quad 0.05\quad -0.05\quad 0.19\quad0.27\quad0.09\quad0.03\quad0.18\quad0.27\quad0.12\quad0.11$$ We get $\bar{z} = 0.133$ and the squared error to $Q_z = 0.1121$.

Let $n$ be the number of data-points. We estimate the standard deviation to: $$\sigma_z \approx s_z = \sqrt{\frac{Q_z}{n-1}} = 0.101$$

Let $H_0 :$ alcohol consumption does not change fat levels, i.e $\Delta = 0$.

A 99% confidence interval for $\Delta$ is: $$I_\Delta = (\bar{z} \pm t_{0.005}(11)\cdot\frac{s_z}{sqrt(n)})$$ $$I_\Delta = (0.133 - 3.11\cdot\frac{0.101}{\sqrt{12}}, 0.133 + 3.11\cdot\frac{0.101}{\sqrt{12}})$$ $$I_\Delta = (0.041, 0.224)$$ Since $0$ is not contained in the confidence-interval, we can with 99% certainty say that $H_0$ is not true, and therefore reject $H_0$ with a significance level of 1%.

The problem:

The textbook seems to use a different method that is confusing to me. Is my method correct too?

2

There are 2 best solutions below

0
On

I put your data into R statistical software, found some preliminary results to compare with yours, and performed a paired t test. Here are the results:

Before
 [1] 0.25 0.19 0.13 0.23 0.15 0.14 0.24 0.23 0.17 0.15 0.10 0.17
After
 [1] 0.50 0.28 0.18 0.18 0.34 0.41 0.33 0.26 0.35 0.42 0.22 0.28
Diff
 [1]  0.25  0.09  0.05 -0.05  0.19  0.27  0.09  0.03  0.18  0.27  0.12  0.11
mean(Diff);  sd(Diff)
[1] 0.1333333
[1] 0.100935
t.test(Diff, conf=.99)

        One Sample t-test

data:  Diff 
t = 4.576, df = 11, p-value = 0.0007955
alternative hypothesis: true mean is not equal to 0 
99 percent confidence interval:
 0.04283811 0.22382856 
sample estimates:
mean of x 
0.1333333 

The 99% confidence interval (CI) in the R output is the same as yours (except for your rounding). Perhaps it is best to retain something like five decimal places during the computation and then to round only when you have the endpoints of the CI.

It is true that a 99% CI that does not include 0 implies that a two-sided test rejects the null hypothesis at the 1% level. However, you have not actually performed the paired t test. (That is probably the "different method" you mention.)

If $X_i$ are the values Before, $Y_i$ are the values After, and $D_i$ are the differences $D_i = Y_i - X_i,$ then the usual formula for the t statistic of the paired t test is

$$ T = \frac{\bar D - 0}{S_D/\sqrt{n}}.$$

With $n = 12$ normally distributed differences, you would reject when $|T| > 3.106.$ Maybe you can verify that this is the t = 4.576 in the R output.

qt(.995, 11)
[1] 3.105807

The P-value given in the R output requires information about Student's t distribution with 11 degrees of freedom that cannot be found precisely from printed tables. In this example, ones rejects the null hypothesis because the P-value is smaller than 0.01.

Because only one of the 12 differences is negative, a 'sign test' for your data would also reject the null hypothesis. If you are interested, you can probably find an explanation of the sign test in your textbook, and you can certainly find an explanation online.

Notes: You have not proved that $\Delta \ne 0.$ It is best to say that the data are 'not consistent' with $\Delta = 0$ at the 1% level of significance. Also, usual English terminology is that $\sigma_x$ is estimated by $s_x.$

0
On

Your method is correct, however you must test the hypothesis. Here it is: $$H_0: \mu_2-\mu_1=\mu_d=0; H_a:\mu_2-\mu_1\ne 0.$$ $$t_{\alpha/2;df}=t_{0.005;11}=3.11;$$ $$t=\frac{(\bar{x_2}-\bar{x_1})-\mu_d}{s/\sqrt{n}}=\frac{\bar{d}-0}{s/\sqrt{n}}=\frac{0.133}{0.101/\sqrt{12}}=4.576.$$ $$\text{Rej. rule}: |t|>t_{\alpha /2} \Rightarrow |4.576|>3.11 \Rightarrow \text{Rej.} H_0.$$ So, there is significant evidence to reject the null hypothesis.