Using Matlab I need to generate a sample x of random numbers (n=30) from the normal distribution, using the command normrnd, and then check whether the normal distribution can be adapted to the sample.
I used the Matlab function chi2gof which gives a result h = 0 which means that `x´ is a sample from the normal distribution. But when the size of the sample is small (n=30) that result doesn't mean much. How could I answer this question when the sample is small?
x = normrnd(50, 2, 30, 1)
h = chi2gof(x)
h =
0
Matlab's Statistics Toolbox contains a number of other tests for normality, including the Anderson–Darling, Jarque–Bera, and Lilliefors tests. The latter appears to be particularly adapted for use with small samples. The Matlab implementation contains tables of critical values which are more precise than those provided by Lilliefors himself and may be made even more precise by running a Monte–Carlo simulation tailored to the given data set.