BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
davidvalentine
Obsidian | Level 7

Hello Beautiful People!

 

I hope all is well!  I am trying to see if the variances of my samples are the same (for brevity's sake I only included 6 data, but my data sets in question have hundreds of rows), but I am not sure which procedure to use in SAS EG 8.1.  Also, is there a way to do this using the "Tasks" feature in SAS EG?  The sample data are below:

 

data work.DummySales;
infile datalines;
	input 
		Month monyy6.
		Sales: dollar10.2 SalesB: dollar10.2 SalesC: dollar10.2;
		format Month monyy. Sales dollar10.2 SalesB dollar10.2 SalesC dollar10.2;
;
datalines;
Jan-12  $6,300.28  $5,400.12  $6,002.77
Feb-12  $7,298.56  $7,919.22  $7,491.08
Mar-12  $5,098.79  $5,989.01  $5,488.23
Apr-12  $5,971.96  $5,622.71  $6,122.21
May-12  $5,585.79  $5,588.66  $5,771.39
Jun-12  $5,575.80  $4,923.47  $5,353.29
;
run;

Which procedure should I use to do this?  And can this procedure be done using "Tasks"?  I've seen PROC GLM in different blogs, but I fail to see why I would want to create a model with my data unless it outputs tests for whether my different samples have the same variance or not.  Any help is greatly appreciated; thanks!

 

-Valentine

1 ACCEPTED SOLUTION

Accepted Solutions
lvm
Rhodochrosite | Level 12 lvm
Rhodochrosite | Level 12

I don't know anything about Tasks in EG, so maybe someone else can answer. The most direct way really is to use PROC GLM. You would have to stack your data, adding a variable to identify the group, assuming you are trying to compare the variances of the three variables.  The HOVTEST option in GLM is easy to use (there are several sub-options). See:

https://documentation.sas.com/?docsetId=statug&docsetTarget=statug_glm_syntax15.htm&docsetVersion=15...

See example at:

https://documentation.sas.com/?docsetId=statug&docsetTarget=statug_glm_examples10.htm&docsetVersion=...

 

Regarding your concern about the need to fit a model: data analysis is almost always about fitting models, even when you don't realize it. Getting the mean and standard deviation for a single sample is equivalent to fitting a model of Y = mu + error. 

 

View solution in original post

2 REPLIES 2
lvm
Rhodochrosite | Level 12 lvm
Rhodochrosite | Level 12

I don't know anything about Tasks in EG, so maybe someone else can answer. The most direct way really is to use PROC GLM. You would have to stack your data, adding a variable to identify the group, assuming you are trying to compare the variances of the three variables.  The HOVTEST option in GLM is easy to use (there are several sub-options). See:

https://documentation.sas.com/?docsetId=statug&docsetTarget=statug_glm_syntax15.htm&docsetVersion=15...

See example at:

https://documentation.sas.com/?docsetId=statug&docsetTarget=statug_glm_examples10.htm&docsetVersion=...

 

Regarding your concern about the need to fit a model: data analysis is almost always about fitting models, even when you don't realize it. Getting the mean and standard deviation for a single sample is equivalent to fitting a model of Y = mu + error. 

 

davidvalentine
Obsidian | Level 7
This was very helpful information, Ivm, especially the part about stacking the data and adding a variable to identify the group(s); I never thought about doing this!

Thank you! 😄

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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
  • 2 replies
  • 3403 views
  • 3 likes
  • 2 in conversation