I have a questions about $p$-value and $t$-test

69 Views Asked by At

Calculation of $p$-value: Fabric water properties, $H_0: \mu \leq 55\%$ versus $H_A: \mu > 55\%$;

$n=15, \bar{x}=59.81\%, s= 4.94\%$

I understand that the hypothesized mean is $55$ samples mean is $59.81$ sample standard deviation is $4.94$ sample size is $15$. And I use the $t$-test, I have gotten $3.77106$. In this circumstance, how can I get the $p$-value, and what is different between critical value and $p$-value?

2

There are 2 best solutions below

2
On

The PDF of a Student $t$ distribution with $\nu = n-1 = 14$ degrees of freedom is $$f_T(t) = \frac{2473099629}{16} \left(\frac{1}{t^2+14}\right)^{15/2}.$$ The desired probability is therefore $$p = \Pr[T > 3.77106] = \int_{t=3.77106}^\infty f_T(t) \, dt,$$ which you can either numerically integrate, or it is integrable in closed form as $$\begin{align*} 1 - F_T(t_0) &= \int_{t = t_0}^\infty f_T(t) \, dt \\ &= \frac{1}{2}-\frac{16 t_0^{13}+1456 t_0^{11}+56056 t_0^9+1177176 t_0^7+14420406 t_0^5+100942842 t_0^3+353299947 t_0}{32 \left(t_0^2+14\right)^{13/2}} \end{align*}$$ which gives $$\Pr[ T > 3.77106] = 1 - F_T(3.77106) \approx 0.00103279.$$ Usually, however, we use computer programs or statistical tables to compute these $p$-values, since the larger the sample size, the more impractical it becomes to evaluate the integral in closed form.

As for your question about the difference between $p$-value and critical value, the $p$-value is in your case the probability that the statistic $T$ is at least as large as the value of the statistic that was observed. That is to say, you are trying to quantify how "unusual" it is to observe the result you computed, assuming the null hypothesis is true. If it is highly unusual (low probability), this means the null hypothesis is unlikely to be true.

It's like saying, if I assume a coin is fair and I toss it $100$ times and get $90$ heads and $10$ tails, is it now likely that my assumption is correct? The way you formalize your conclusion is that if the coin were fair, the probability of obtaining such an extreme result is very small. The $p$-value is this probability. But if you had assumed that the coin has a probability of $0.9$ of landing heads up, $90$ heads and $10$ tails would not be unusual at all.

The critical value is another way of making a decision about a hypothesis test. Instead of a probability, a critical value is a quantile: in your case, it is some value $t_{\text{crit}}$ such that $$\Pr[T > t_{\text{crit}}] = \alpha,$$ where $\alpha$ is the significance level or Type I error probability of your test. In other words, this is your way of deciding whether the test statistic you observe should lead you to reject the null hypothesis. If you want to have at most an $\alpha = 5\%$ chance of incorrectly rejecting the null when it is actually true, then you want to find some number $$\Pr[T > t_{\text{crit}}] = 0.05,$$ which is the $95^{\rm th}$ percentile of the Student $t$ distribution with $14$ degrees of freedom, which using a computer, is about $t_{\text{crit}} \approx 1.76131$. That means if your test statistic is larger than this value, you would reject $H_0$. It also means for any $T > 1.76131$, the $p$-value is less than $0.05$.

2
On

The t statistic is $t = \frac{59.81 - 55}{4.94/\sqrt{15}} = 3.771.$

(59.81 - 55)/(4.94/sqrt(15))
[1] 3.771063

P-value from software. The P-value is the probability to the right of 3.771 in a Student's t distribution with 14 DF. Usually, one uses software to get P-values. In R, the computation of the P-value 0.001 is shown below.

In this particular case, you may be able to come very close to this P-value by looking in a printed table of t distributions, on line 14 (for DF = 14). [Usually, all you can do from a table is to 'bracket' the P-value between two tabled values.]

1 - pt(3.771, 14)
[1] 0.001032913

Critical value from printed table. The critical value $c = 2.624$ for a test at the 1% level can be found in a printed table or using software such as R. You would reject $H_0$ at the 1% level for a t statistic greater than $c.$

qt(.99, 14)
[1] 2.624494

Addendum: Some statistical software programs will show results of a t test based on summary data [sample size, mean, S] and hypotheses [hypothetical value of population mean, direction(s) of alternative]. Here is output from the 'one-sample t test' procedure in Minitab.

One-Sample T 

Test of μ = 55 vs > 55


  N   Mean  StDev  SE Mean  95% Lower Bound     T      P
 15  59.81   4.94     1.28            57.56  3.77  0.001