# One sided test $H_0:\mu=0$ or $H_0:\mu\leq 0$? [duplicate]

I want to test

$$H_0: \mu \leq 0 \,\,\,\,\,\, vs \,\,\,\,\,\, H_1: \mu > 0.$$ I am using a t test, so the statistic $$T$$ has $$\nu$$ degrees of freedom which depend on the sample size.

What is the difference between testing $$H_0: \mu \leq 0$$ or $$H_0: \mu = 0$$ vs $$H_1: \mu >0$$?

Is it possible to test only $$H_0: \mu \leq 0$$?

In R command t.test(), it seems that this is equivalent to specifying alternative = "greater", but there seems to be no distinction between the two hypothesis?

## marked as duplicate by Scortchi♦Jan 2 at 17:20

• Welcome to Cross Validated! I think the linked post answers your question. Note that even with the composite null $H_0: \mu \leq 0$, the simple null $H_0: \mu = 0$ is the closest to the alternative hypothesis & the tests therefore become the same in practice when $t>0$. – Scortchi Jan 2 at 17:30

The difference is in the alternative hypothesis.

H0: μ ≤ 0 --> Ha: μ > 0

H0: μ > 0 --> Ha: μ <= 0

H0: μ = 0 --> Ha: μ > 0 or μ < 0

I.e. for the first two case, you are asking the question: "Is mean significantly bigger (μ ≤ 0) / smaller (μ > 0) than 0?", while for the third case, you're asking: "Is the mean significantly different from 0?" (either bigger or smaller)

In case you're testing H0:μ ≤ 0, you are summing up the upper tail of the null-distribution to obtain a p-value (one-sided test).

When testing H0:μ = 0, you are summing up both the upper and lower tail (two-sided test).

• I have added more details to the question. In all the cases, I am considering the same alternative hypothesis, it is the null what changes. Apologies if this was not clear. – Goose Jan 2 at 16:31
• No you're not. The alternative hypothesis, or rather the (infinitely large) set of alternatives is defined based on the hypothesis, i.e. for H0: μ <= 0, the set of alternatives included every u1 > 0, while for H0: μ = 0, the set includes every μ1 != 0. Here, you define H0 based on these sets. For example, "greater" implies H0: μ <= 0 while "two.sided" is equivalent to "greater" OR "less", thus implying H0: μ = 0. – bi_scholar Jan 2 at 16:37
• This is actually a classical theory known as one-sided alternative tests: see, so, the alternative is not always the complement of the null. – Goose Jan 2 at 16:39
• @Goose, see my edited comment. Again, H0: u = 0 and H0: u <= 0 are very different hypothesis, since you sum up either one or both tail of the null-distribution. See the plots given here. en.wikipedia.org/wiki/One-_and_two-tailed_tests – bi_scholar Jan 2 at 16:43
• My question is about whether it is different to test $H_0: \mu \leq 0$ vs $H_1: \mu >0$ OR $H_0: \mu =0$ vs $H_1: \mu >0$, as it seems that R does not distinguish between these. – Goose Jan 2 at 16:47