본문 바로가기
AI월드/⚙️AI BOOTCAMP_Section 1

Convert two-tailed to a one-tailed test

by khalidpark 2021. 1. 10.

The easiest way to convert a two-tailed test into a one-tailed test is to divide in half the p-value provided in the output. 

two tail test p value 값을 반으로 나눠라

 

In the output below, under the headings Ha: diff < 0 and Ha: diff > 0 are the results for the one-tailed tests,

 

and the results in the middle, under the heading Ha: diff != 0 (which means that the difference is not equal to 0), is the two-tailed test. 

 

남자의 평균과 여자의 평균이 같을 것이다 (귀무가설 , H0)

 

남자의 평균과 여자의 평균은 같지 않을 것이다 ( 2 tail test 대안가설 , Ha != 0)

남자의 평균이 여자의 평균보다 클 것이다 (1 tail test 대안가설)

남자의 평균이 여자의 평균보다 작을 것이다 (1 tail test 대안가설)

 

We can look at the output below and see that this is done to create the appropriate p-value for the predicted direction (see bolded portion). 

제일 하단 집중해서 보자

 

Notice, though, that there is no way to get a statistically significant result in the other direction. 

 

You need to make the directional prediction before you conduct the test, and if the result goes in the opposite direction, even if it would have been statistically significant with a two-tailed test, it is not statistically significant. 

 

Note that the test statistic, -3.7341, is the same for all of these tests. 

The two-tailed p-value is P > |t|.

This can be rewritten as P(>3.7341) + P(< -3.7341). 

Because the t-distribution is symmetric about zero, these two probabilities are equal: P > |t| = 2 *  P(< -3.7341).

Thus, we can see that the two-tailed p-value is twice the one-tailed p-value for the alternative hypothesis that (diff < 0). 

The other one-tailed alternative hypothesis has a p-value of P(>-3.7341) = 1-(P<-3.7341) = 1-0.0001 = 0.9999.  

 

So, depending on the direction of the one-tailed hypothesis, its p-value is either 0.5*(two-tailed p-value) or 1-0.5*(two-tailed p-value) if the test statistic symmetrically distributed about zero. 

 

In this example, the two-tailed p-value suggests rejecting the null hypothesis of no difference.

(p value 0.002이다. 0.05보다 작으므로 reject null hypothesis)

 

Had we opted for the one-tailed test of (diff > 0),

we would fail to reject the null because of our choice of tails. 

 


Unlike the example above, only the two-sided p-values are presented in this output.

 

For each regression coefficient, the tested null hypothesis is that the coefficient is equal to zero. 

Thus, the one-tailed alternatives are that the coefficient is greater than zero and that the coefficient is less than zero.

 

To get the p-value for the one-tailed test of the variable science having a coefficient greater than zero,

you would divide the .008 by 2, yielding .004 because the effect is going in the predicted direction. This is P(>2.67).

 

If you had made your prediction in the other direction (the opposite direction of the model effect), the p-value would have been 1 – .004 = .996. 

 

This is P(<2.67). For all three p-values, the test statistic is 2.67. 

 

 

 

stats.idre.ucla.edu/other/mult-pkg/faq/general/faq-what-are-the-differences-between-one-tailed-and-two-tailed-tests/

 

FAQ: What are the differences between one-tailed and two-tailed tests?

 

stats.idre.ucla.edu

출처 : stats.idre.ucla.edu/other/mult-pkg/faq/pvalue-htm/

 

pvalue.htm

 

stats.idre.ucla.edu

data-make.tistory.com/127

 

[Statistics/R] 가설검정

참고글 : [Statistics] 가설 검정 및 추정 [Statistics] p-value 란? [Statistics/R] 모집단 추론, 추정 [Statistics] 모집단과 표본 #. 가설검정   - 표본평균으로부터 모수(모집단의 특성을 나타내는 통계량)..

data-make.tistory.com

 

728x90

댓글