I am badly strugling to find P-values. I have no idea how it is coming for every problem I am doing. For example, the question below, how did they get/choose alpha 0.1 and 0.5 to calculate calculate it as P value? because in question there is no alpha given. Please help!
How to find P value?
2.4k Views Asked by user139485 https://math.techqa.club/user/user139485/detail AtThere are 2 best solutions below
On
This is a more complete chi-square table:
a) $\chi^2=25.2, n=20$. It means the df $=n-1=19$. The degrees of freedom (df) are given on the left and the p-values are given at the top. First one must find df. Then one must find the interval where the given test statistic fits in. Note: $$\underbrace{18.34}_{\chi^2_{0.5,19}}<\underbrace{21.689}_{\chi^2_{0.3,19}}<\underbrace{23.9}_{\chi^2_{0.2,19}}<\underbrace{\color{red}{25.2}}_{\chi^2_{\color{red}{0.154},19}}<\underbrace{27.2}_{\chi^2_{0.1,19}}$$ Note: p-value=$P(\chi^2>25.2)=0.154$ can be found in MS Excel: "=chisq.dist.rt(25.2;19)".
b) $\chi^2=15.2, n=12$. It means the df $=n-1=11$. $$14.631<\color{red}{15.2}<17.275$$ Can you figure out the interval of p-value? Answer:
$0.1<p-value<0.2.$
Can you do c)? Answer:
$0.99<p-value<1.$

The p-value for a right-tail test as in this problem is defined to be the probability under the null hypothesis that the test statistic would come out as great or larger than the observed test statistic. In the first question the test statistic is $\chi^2$ with $19$ degrees of freedom and the observed value of the test statistic is $25.2.$ So we need to compute the probability that a $\chi^2$ with $19$ degrees of freedom is $\ge25.2.$
This is just a computation we need to make about a known probability distribution. There are many ways we can compute this. One way is to look up the density of this distribution and take an integral to compute the area of the tail above $25.2.$ Fortunately, however, nearly every software package for data analysis will have a function implemented to compute $\chi^2$ tail areas. For instance in a GNU octave prompt, I type
1-chi2cdf(25.2,19)and get an answer of $0.154.$ That's the p-value.But the way they are having you compute is via tables, like it's 1950 or something. Instead of having a function that will compute the p-value for you, they give you a list of values that will yield certain p-values (often called "critical values"). For instance, if we saw slightly more extreme value of the test statistic, $27.2$ instead of $25.2,$ we would get a p-value of $0.1$, which is lower than $0.154$ (which makes sense since it's more extreme data which gives us stronger evidence to reject the null.) This is what is meant by the tabulated value $\chi^2_{0.1,19}=27.2.$
Apparently the next p value tabulated above $0.1$ is $0.5$ and we have $\chi^2_{0.5,19}=18.34,$ which means that if the data had been $18.34$ instead of $25.2$ we would have a p-value of $0.5$ (and it makes sense it went up since this is less extreme data which doesn't give us much evidence to reject the null). I can verify this with software by typing
1-chi2cdf(18.34,19)and verifying the the answer is $0.5.$The fact that $18.34 < 25.2 < 27.2$ indicates that the p-value is between $0.1$ and $0.5,$ which is the answer they come to. The fact that it is a lot closer to $27.2$ than $18.34$ suggests it is closer to $0.1$ than it is to $0.5,$ which is indeed the case since the exact answer is $0.154.$
How did they "get" the $0.1$ and $0.5$? They just noticed that $\chi^2_{0.1,19}$ and $\chi^2_{0.5,19}$ were the two critical values that $25.2$ was in between. If the test statistic had been $27.5,$ then it would have been $0.05$ and $0.1.$