# Non-Parametric altervative to one sample t-test

I have a the following hypothesis: $H_0: \mu=4$, $H_1: \mu\neq 4$, which I wanted to test using a one sample t-test.

However, my data is not normally distributed and a transformation was not found. Which test should I use instead? What makes things harder is the 4, I think.

• Can you say more about your data? What do the values measure? Why are you testing a null value of 4? Is your interest actually on the population mean? – Glen_b -Reinstate Monica Oct 10 '16 at 1:50

The 4 doesn't pose any problem. Just subtract 4 from every observation and you can test $$\mu=0$$ on the shifted data.

There are two common nonparametric tests of location which might be relevant to you -- the Wilcoxon signed rank test and the sign test.

The signed rank test is a test for the pseudo-median. When accompanied by the assumption of symmetry (which the signed rank test needs for the permutations to be equally likely under the null), the population pseudo-median will equal the population median, and (by symmetry) will also equal the population mean when it is finite (which is hereafter assumed to save repeating it every time I mention the mean). Which is to say, under the usual assumptions the signed rank test is a suitable test for a mean as well as a median (keeping in mind that strictly that assumption is only required when the null is actually true).

The sign test doesn't require the assumption of symmetry to be a valid test but it's a test for the median rather than the mean, so you'll still need an assumption that would make the two equal (for which symmetry is sufficient but not necessary, since many asymmetric distributions can also have mean=median).

There's also the possibility of performing a permutation test based on the mean. This will be similar to the signed rank test but performed on the original observations rather than the ranks. In order that the signs can be permuted under the null, you would (again) assume symmetry.

Josh suggested the bootstrap as another possibility, and that should work quite well (though it will tend to have closer to the desired significance level if you have fairly large samples). It should not require any assumption of symmetry.

Another possibility is a different parametric assumption (one more suited to the situation you're sampling, which you haven't stated). For example you might assume that the data are drawn (say) from an exponential distribution, and test whether the mean is 4 against the alternative that it is different from 4.

Finally if the distribution is not very far from normal you might simply proceed with the t-test. [While the significance level might not be badly affected by the non-normality, the power can be if you're not at least reasonably close to normality. This is not an issue that goes away with larger samples.]

• Hi Glen, I have a question. If your sample size is very very large, even a tiny difference can be significant, for example, the mean is 4.01 and the sample size -> infinity. But if the difference is practically "insignificant", how is one to conduct a proper test? – user8463728 Aug 18 '17 at 14:12
• What do you mean by "a proper test" here? Are you sure you want a hypothesis test rather than something else? What is it you want to find out? (It sounds like this should be a new question with all the details of whatever you're trying to achieve) – Glen_b -Reinstate Monica Aug 18 '17 at 21:41

How large is your sample? Normality of the data is not required for testing the sample mean if the sample size is large enough. A common cutoff given to students is $n=30$.

Alternatively, you could use the Wilcoxon Signed-Rank test, but for one sample that's actually testing the median.

Finally, the bootstrap might work well in this case.

• The signed rank test isn't of itself a test for the median (it's a test for the pseudo-median). When combined with the symmetry assumption under the null (that you need to make the signs of the ranks exchangeable there) that will make it a test for the median -- but will also make it a test for the mean (assuming the population mean exists). – Glen_b -Reinstate Monica Oct 10 '16 at 1:53
• Ah, you're right, and I had never paid attention to the symmetry assumption before. I am ashamed. In that case, other than just bootstrapping, I don't know of so many one sample tests for this... Now I want to learn too! – Josh Magarick Oct 10 '16 at 4:25