BookmarkSubscribeRSS Feed
fengyuwuzu
Pyrite | Level 9

I want to do a t-test and also ANOVA. But my data is extremely positive skewed.  I used log transformation to normalize it. Then I did a normality test.

The three tests gave different P-values. For Kolmogorov-Smirnov, the P-value is >0.05, but the other two tests are <0.05.

sample size 67994. Is this transformation acceptable for normality considering t-test and anova analysis?

 

 

proc univariate data = test1 normal;
  class gender;
  var newvar;
  histogram /normal kernel;
  qqplot newvar;
run;

 

Goodness-of-Fit Tests for Normal Distribution
Test Statistic p Value
Kolmogorov-Smirnov D 0.09694082 Pr > D 0.119
Cramer-von Mises W-Sq 0.14977297 Pr > W-Sq 0.024
Anderson-Darling A-Sq 0.98653289 Pr > A-Sq 0.013

 

 

Capture.PNG

 

 

 

Capture1.PNG

6 REPLIES 6
pearsoninst
Pyrite | Level 9
You should go for AD than KS , as KS is more centric the middle of the data .
Here is one research artical which may help you.

https://www.researchgate.net/publication/267205556_Power_Comparisons_of_Shapiro-Wilk_Kolmogorov-Smir...
SteveDenham
Jade | Level 19

But also beware that the tests here are immensely over-powered to detect differences.  You will learn far more from the QQ plot.  That long flat part at the beginning is evidence that there is a mixture here, and a rough look at the data makes me think that you are using a lower limit of quantitation value for a lot of observations.  If that is the case, there are a number of ways to address the issues of analysis.

 

Also, the assumptions of ANOVA (and of the t test) are not that the data are normally distributed, but that the errors/residuals are normally distributed.  Try running the analysis on the transformed data, and then testing the residuals for normality.

 

With a sample size this large, and the known conservatism of tests for normality, p values in this range should probably not be regarded as strong evidence for lack of normality of the residuals, which the ANOVA is relative robust to, in any case.

 

Steve Denham

 

 

Rick_SAS
SAS Super FREQ

You do not need o transform your variable. The UNIVARIATE procedure can fit a lognormal and other skewed distributions.

 

As Steve points out, the Q-Q plot contains the graphical information about the fit. To learn more about the Q-Q plot and how to create it in SAS, see "Modeling the distribution of data? Create a Q-Q plot."

lvm
Rhodochrosite | Level 12 lvm
Rhodochrosite | Level 12

I would not use a test for normality with 68,000 observations. You will almost always get a 'significant' result. Graphic appraisal is best.

PGStats
Opal | Level 21

Compare the p-value you get with ANOVA or ttest on the log-transformed data with the p-value from Wilcoxon rank sum (non parametric) test from proc NPAR1WAY on the untransformed data. The later should confirm the former.

PG
SteveDenham
Jade | Level 19

I like this approach @PGStats, except all of the ties with the lower bound mean a loss of power.  I would suggest a tobit analysis on the log transformed data (say with PROC QLIM), but that might make a newcomer to SAS run screaming, I'm afraid.

 

Steve Denham

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 6 replies
  • 2433 views
  • 2 likes
  • 6 in conversation