3
$\begingroup$

I have been reading that people use the one-sample t-test also for skewed underlying distributions, saying that for a high enough number of datapoints (I read for example N=30 and N=100 in some places) the central limit theorem means that you can apply the t-test even to non-normal data. I struggle to understand the argument.

In case of the one-sample t-test I only have one sample, whose distribution is not normal. I don't have multiple samples with multiple means, that would follow a normal distribution according to the CLT. In my understanding of the CLT it does not apply to a one sample case? Why do people say that with enough datapoints in my one sample these two cases are equivalent? Is this just obvious and I am not seeing it? Where do people get the N=30 from, and how do I find out which N is appropriate for my case?

$\endgroup$
1
  • $\begingroup$ Welcome to CrossValidated, and thank you for a very nice first question! $\endgroup$ Commented Dec 13, 2023 at 11:52

2 Answers 2

7
$\begingroup$

I am not sure where you read that, or what the exact argument was. I think maybe you got it from some site comparing t test to z test. Googling on "one sample t test large sample" found some references to this. I don't think it's relevant here. Here, neither the t nor the z is appropriate.

Intuitively, the one sample t test is a test of whether the mean is equal to 0 (you can adjust this to another value). The mean is generally not recommended as a measure of central tendency for skewed distributions (although there are exceptions) so we usually shouldn't use the t-test on such distributions.

The assumptions of the t-test include one sample normality. I've not seen any exception for large samples. Laerd statistics lists four assumptions. Briefly, they are:

  1. DV is measured at interval or ratio level.
  2. Data are independent.
  3. No significant outliers.
  4. DV is approximately normally distributed.

(See the link for details).

So, I suggest using an alternative test. Which one would depend on your exact question and the shape of the distribution (e.g. are there outliers?)

$\endgroup$
4
  • 1
    $\begingroup$ Regarding to where I found this: For the one-sample t-test specifically, questions like here or here, and some opinions of people I talked to. However it is possible I misunderstood some of it. It floats around the internet for both the one-sample and the two-sample t-test, but I have not found it stated in any statistics book or sth. $\endgroup$
    – Mars
    Commented Dec 14, 2023 at 12:45
  • $\begingroup$ Regarding to what I want to test: My data describes a vectorial quantity (wind), specifically right now I look at the length of the vector (windspeed), so it is always larger than 0. There exists a model to describe this data, which gives me one datapoint per hour and assumes a steady state in this hour. I make around 400 measurements per hour (in reality there of course is no steady state, so my distribution usually has a tail towards higher values, and is always cut of at 0). I want to find a measure to evaluate for which hours the model value describes the data. $\endgroup$
    – Mars
    Commented Dec 14, 2023 at 12:58
  • $\begingroup$ Additionally: Thank you for your answer!!! $\endgroup$
    – Mars
    Commented Dec 14, 2023 at 13:04
  • $\begingroup$ That is a very different goal! I suggest writing a different question, with that goal explicitly stated, and the specifics of your problem explicitly stated as well. $\endgroup$
    – Peter Flom
    Commented Dec 14, 2023 at 14:59
7
$\begingroup$

On the one hand, Peter Flom makes a good point that the mean may not be the "best" way to describe a skewed distribution.

Then again, it may well be. (I do retail forecasting. Retail sales are usually skewed, and we are still interested in expected sales, e.g., for promotion planning.)

And then, it turns out that even for highly skewed original data, the mean is asymptotically normally distributed. $N=30$ is empirically a not too unreal sample size for this to be "true enough".

As an example, let's simulate a population that is Beta(2,0.5) distributed. This is quite skewed indeed:

population

However, let's now draw a sample of size $N=30$ and calculate the mean. Let's do this many times to get an idea of the distribution of the mean. Here is a histogram:

means

We see that this already looks "much more normal" than the population. Of course, it is not normal, since the means all will be between zero and one. But it is close enough for a one-sample t test to have close to the correct size and power.

In case of doubt, you could always bootstrap the mean. This is also a little questionable for small sample sizes, but it at least gives you an additional data point.

This is related, for the two-sample case: t-test when the data population is not normally distributed

R code:

nn <- 1e5
population <- rbeta(nn,2,0.5)
hist(population)

means <- replicate(1e4,mean(sample(population,30,replace=FALSE)))
hist(means)
$\endgroup$
4
  • 1
    $\begingroup$ "close enough" is something you can quantify here; you didn't seed your simulation but running an $\alpha=0.05$ one-sample t test in each sample versus the population mean you can get type I assertions as high as 0.07 - perhaps acceptable? Under a standard log-normal distribution (quite skewed) you see this at about 0.37 for N=30, definitely not good. $\endgroup$
    – PBulls
    Commented Dec 13, 2023 at 12:07
  • 1
    $\begingroup$ As a side note, the central limit theorem has hidden assumptions making it far less helpful than most statisticians think. It assumes for one thing that the standard deviation is a good measure of dispersion. When the data are asymmetric this is not the case. Then the SD and mean are no longer independent. The bottom line is poor confidence interval coverage probabilities. To the original point, in the spirit of the Bayesian $t$-test (see here I would use a 4-parameter distribution and get a Bayesian uncertainty interval for the mean. $\endgroup$ Commented Dec 13, 2023 at 13:17
  • $\begingroup$ @StephanKolassa Thank you for answering! I think this is precisely the point I have seen being made now multiple times and I just don't understand. Why is it relevant that if I take many samples their distribution becomes approximately normal (CLT)? Because in the one-sample t-test I only have one sample (which is definitely not normally distributed), not many. So I don't get why the point with the many samples should be relevant to the one-sample case? (I will research bootstrapping, maybe that will help). $\endgroup$
    – Mars
    Commented Dec 14, 2023 at 13:13
  • $\begingroup$ That is absolutely a good point. However, note that it applies to all statistical tests, not just ones that rely on asymptotics via the CLT. If your population is normally distributed, then the sample mean is normally/t distributed "directly", no need for the CLT... but you still only have a single mean! And all of t-tests relies on taking such a single mean or t statistic as a single data point from a normal/t distribution and deriving conclusions from this. So if this "single draw issue" gives you qualms, you should not be doing inferential statistics in the first place... $\endgroup$ Commented Dec 14, 2023 at 13:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.