Testing for Mean Differences in Seasons

Reply
Frequent Contributor
Posts: 79

Testing for Mean Differences in Seasons

I have some data that is organized into seasons. I would like to test for significant differences between the seasons (spring summer fall winter). I can generate the means fine:

 

ods graphics on;
proc sort data=tafsas.nav_data_all_ts;
	by season_name;

proc means data=tafsas.nav_data_all_ts noprint;
   var ovr_ecu;
   by season_name;
   where date>='01Jan2010'd;
   output out=meanstest mean=;
run;

ods graphics off;

So I am not sure how to proceed from here.  Any advice is appreciated.

 

 

Thx.

Regular Contributor
Regular Contributor
Posts: 218

Re: Testing for Mean Differences in Seasons

Mean what? 

 

Mean precipitation by season?  Mean number of births?  Mean number of earthquakes?

 

Just a little bit more help on what data you might have, what they might represent, and what you might want to do would be helpful.

Super User
Posts: 21,530

Re: Testing for Mean Differences in Seasons

You decide on the statistical test first, you don't calculate summary statistics either, the PROCS will handle that. 

 

Look at PROC ANOVA and GLM for starters. 

 

But...this data is circular/seasonal so make sure to correct for that first, I've recently seen some interesting radar charts and the concept of standardizing with sin/cosine functions. Radar charts are great for visualizing the data because it accounts for the fact that Summer is between Spring and Fall, whereas that's harder to view in other graphic types. 

Esteemed Advisor
Posts: 5,124

Re: Testing for Mean Differences in Seasons

You will most likely want to remove the year effect before looking at the season effect. Simple example where the year effect is considered random :

 

data test;
set sashelp.air;
season = qtr(date);
year = year(date);
run;

/* year as a random effect */
proc glimmix data=test plots=none;
class season year;
model air = season;
random year;
lsmeans season / pdiff;
run;
PG
Frequent Contributor
Posts: 79

Re: Testing for Mean Differences in Seasons

Thank you for all repsonding. This is airline costing data used at an air navigation service provider. It is monthly based. The data is monthly in frequency and is able to be grouped into seasons (spring, summer, fall, winter) based on month. I'd just like to see in 5-10 year chuncks (the chuncking can be done later) if the means of each season are significantly different from one another.

 

It seems like the suggestion to use proc glimmix is a good one. I had simply broken up the sample into groups and used t-tests, but it does not seem as elegant as proc glimmix above. Is glimmix the preferred method for this inquiry?

Esteemed Advisor
Posts: 5,124

Re: Testing for Mean Differences in Seasons

Check out the assumptions behind mixed linear models and decide if they are appropriate for your data.

 

Note, proc glimmix might a bit overkill here, you could just as well use proc mixed if all random effects can be assumed to be normally distributed.

PG
Ask a Question
Discussion stats
  • 5 replies
  • 86 views
  • 1 like
  • 4 in conversation