How to check if data is normally distributed

Illustration
Nancy - 2022-07-04T13:47:15+00:00
Question: How to check if data is normally distributed

Hi all,   I want to run a f-test on two samples to see if their variances are independent. Wikipedia says that the f test is sensitive to non normality of sample (. How can I check if my samples are normally distributed or not.   I read some forums which said I can use kstest and lillietest. When can I use either? I get an answer h=0. Does that mean my data is normally distributed?

Expert Answer

Profile picture of Kshitij Singh Kshitij Singh answered . 2025-11-20

You cannot tell from only 2 samples whether they are normally distributed or not. If you have a larger sample set and you are only testing them in pairs, then you could use the larger sample set to test for a particular distribution.
 
 
For example: (simple q-q plot)
 
 
data= randn(100); %generate random normally distributed 100x100 matrix
ref1= randn(100); %generate random normally distributed 100x100 matrix
ref2= rand(100); %generate random uniformly distributed 100x100 matrix

x=sort(data(:));
y1=sort(ref1(:));
y2=sort(ref2(:));

subplot(1,2,1); plot(x,y1); 
subplot(1,2,2); plot(x,y2);

The first plot should be a straight line (indicating that the data distribution matches the reference distribution. The second plot isn't a straight line, indicating that the distributions do not match.


Not satisfied with the answer ?? ASK NOW

Get a Free Consultation or a Sample Assignment Review!