I am a bit confused regarding this issue. From my understanding the normal distribution and t distribution we look at the left tail for a one tail test and for the f and chi-squared we look at the right.
2 Answers
Rather than giving a man a fish, maybe it's better to teach a man to fish:
Suppose we don't know if the qf gives the quantiles measured from the left or right tail, and we can't figure it out from the documentation. One test we might use is to call the function over a range of probability values and see if the quantiles returned are increasing or decreasing.
#Call outputs of the function qf
PROBS <- seq(from = 0, to = 1, by = 0.05)
qf(PROBS, df1 = 4, df2 = 6)
[1] 0.0000000 0.1622552 0.2493921 0.3278960 0.4043197 0.4815638 0.5615268 0.6458107
[9] 0.7360243 0.8339843 0.9419133 1.0626959 1.2002700 1.3602830 1.5512907 1.7871545
[17] 2.0924149 2.5164101 3.1807629 4.5336770 Inf
Looking at the output, we see that the quantiles are increasing with respect to the probability values, which tells us that the quantile outputs are with respect to the lower tail area. Sure enough, if we read the documentation for the qf function we see that there is a logical parameter lower.tail that controls this. To round out our checks, let's look at the output when we change the default value of this parameter:
#Call outputs of the function qf with lower.tail = FALSE
qf(PROBS, df1 = 4, df2 = 6, lower.tail = FALSE)
[1] Inf 4.5336770 3.1807629 2.5164101 2.0924149 1.7871545 1.5512907 1.3602830
[9] 1.2002700 1.0626959 0.9419133 0.8339843 0.7360243 0.6458107 0.5615268 0.4815638
[17] 0.4043197 0.3278960 0.2493921 0.1622552 0.0000000
Now we see that the quantiles are decreasing with respect to the probability values, which tells us that the quantile outputs are now with respect to the upper tail area.
- 124,856
As I read your question, you are puzzled about the fact that some onesided tests use the upper tail, while others use the lower tail of a distribution to determine if the null hypothesis is rejected.
The reason is, that one always puts the rejection where one would expect more frequent results when the null hypothesis is wrong, than when it is true. For the chi-square test, large values of the test statistic occur more often when the null hypothesis is wrong, therefore one uses the right-tail quantile.
When you make a one-sided to compare the mean of two normal populations, the test statistic is something like $T = (\bar{X}_1 - \bar{X}_2)/\sqrt{S^2/n}$. This statistic has a t-distribution if the null hypothesis is true, and t-distributions are symmetric. The left quantile is just negative the right quantile. Many statistics books only use one quantile, for example the left, and put a " - " in front of the quantile if they need the other one (the right quantile). In reality, you are using either the left or the right quantile, depending on the alternative of a one-sided test.
- 2,580
- 1
- 8
- 22
R, it accepts alower.tailargument. Thus, the answer to your question is found by reading the help page for the function. Type?qfat the prompt. Because that settles the software issue, it is proper for respondents to focus on the implicit statistical question. For background on that, have you seen https://stats.stackexchange.com/questions/31? – whuber May 22 '23 at 22:42