I have a dataset where I want to see if the time of the day (divided into categories of 4 hour intervals) has an effect/makes a difference in the length of stay of visitors. I thought to use one way ANOVA, however, when running the Levene's Test for homogeneity, I got a significant p-value which doesn't meet my assumption of equal variance. Any suggestions of what is the best test to use in this case? Thanks in advance!
Take out outliers if they are truly aberrant (i.e. measurement errors or measurements outside the scope of your study). But don't throw them out just for the sake of running a parametric test. Use a robust test like the one I suggested instead.
First, check your data for outliers. Otherwise, the Wilcoxon test provided in proc NPAR1WAY is a good alternative.
Take out outliers if they are truly aberrant (i.e. measurement errors or measurements outside the scope of your study). But don't throw them out just for the sake of running a parametric test. Use a robust test like the one I suggested instead.
Simple. For example, does car engine size differ among car models of different origins?
proc npar1way data=sashelp.cars wilcoxon;
class origin;
var enginesize;
run;
Note, the Wilcoxon test is called Kruskal-Wallis when comparing more than 2 categories.
You might also consider using PROC MIXED. PROC MIXED allows you to model the unequal variances. For example,
proc mixed;
class hour;
model y=hour;
repeated / group=hour;
run;
This program estimates different variances in y for different groups in HOUR, and the inferences would take into account different variance estimates.
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.