4
$\begingroup$

I understand that according to CLT the estimator would become normal but, If my population is not normally distributed, let's say it is uniformly distributed. Can I use t-test? let's also assume that I have a large sample size more than 1000.

$\endgroup$

1 Answer 1

8
$\begingroup$

Yes, you can, for precisely the reason you give: even if the underlying population is not normally distributed, the mean (or more precisely the difference between the means) is asymptotically normal. (There are some conditions on the underlying populations that are usually satisfied in the real world, and certainly for underlying uniform distributions.)

Let's illustrate with a simulation (R code): we consider two populations, one $U[0,10]$ and the other $U[0.5,10.5]$, and a total sample size of 1000, half from each population. Here is a sample and a t-test:

nn <- 1000

draw_1 <- function(n) runif(n, 0, 10)
draw_2 <- function(n) runif(n, 0.5, 10.5)

set.seed(1)
sample_1 <- draw_1(nn/2)
sample_2 <- draw_2(nn/2)

t.test(sample_1,sample_2)

which yields

        Welch Two Sample t-test

data:  sample_1 and sample_2
t = -3.1827, df = 996.74, p-value = 0.001504
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
 -0.9387957 -0.2226748
sample estimates:
mean of x mean of y 
 4.956549  5.537284

Now, to see that the difference in means is normal enough, we simulate drawing samples and calculating means many times:

means <- replicate(1e4,{
    sample_1 <- draw_1(nn/2)
    sample_2 <- draw_2(nn/2)
    mean(sample_2)-mean(sample_1)})

hist(means)

histogram

Of course, this difference is not really normal (for one, it's bounded between -9.5 and 10.5, whereas the normal distribution is unbounded), but it's normal "enough" for the t test to work.

$\endgroup$
4
  • 4
    $\begingroup$ Down-vote is a puzzlement. So (+1) now. Similar recent Q&A. Permutation test is nice idea. $\endgroup$
    – BruceET
    May 14, 2020 at 6:44
  • $\begingroup$ @BruceET: Thank you! I would also be interested in the reason for the downvote. $\endgroup$ May 14, 2020 at 6:52
  • $\begingroup$ Thank you, this made a lot of things clear but, this brings up another question. So according to CLT, the mean of the sample or the test statistic will be asymptotically normal at some 'n' for any underlying distribution. Then when do we move to non-parametric tests like wilcoxon and how do we check for the asymptotic normality of test statistic? In real life we will have only one value for test statistic. $\endgroup$
    – Angadishop
    May 14, 2020 at 15:04
  • 3
    $\begingroup$ Nonparametric tests have their place if $n$ is small. For medium-sized $n$, one can bootstrap the test statistic to get a feeling for whether asymptotics have already kicked in. I used to hand-code permutation alternatives to parametric tests in quite complicated situations precisely because I was afraid the $n$ was not yet large enough, and found to my dismay that p values were very close to the ones from the parametric test. In the end, it really comes down to experience. $\endgroup$ May 14, 2020 at 15:31

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.