BookmarkSubscribeRSS Feed
jhats
Calcite | Level 5

I'm looking to finish my dissertation and the last of my analysis requires ANOVA with weighted data.  I also need to get a mean score value.  Can you use the same code as used for a t test to get ANOVA data?   Right now, I have use this (example) for the t test.  I'm using SAS v9.3.

proc surveymeans data=XXXX t;

class vary varx; *categorical variables;

weight weightvar;

var vary varx;

run;

If this is the correct code, then how do I get the mean score value?

Am I doing this correctly?

Any advice would be greatly appreciated! 

2 REPLIES 2
SteveDenham
Jade | Level 19

First, a t-test on the proportions may be the only test you can get from SURVEYMEANS.  I could be wrong and if others know better, I hope they will contribute. To get the ANOVA with weighted data you are probably going to have to shift to PROC SURVEYREG.  For that to work, you will need classification variables and a response variable.  I presume vary and varx are the classification variables.  More info on this part will make responding easier.

To get mean score values from SURVEYMEANS, try dropping the class statement and adding 'mean' to the proc statement:

proc surveymeans data=XXXX t mean;

weight weightvar;

var vary varx;

run;

I do wonder what meaning you can attach to a mean for categorical variables, however.  It will be dependent on the number of categories and response patterns.  Perhaps the median and various quantiles would be more informative.  I don't know the field you are working in, so I can't say what might be standard practice.

With more info on the design and sampling schema, I am sure that SURVEYREG can be adapted to do the ANOVA.

Steve Denham

SeanM
Calcite | Level 5

 

 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 6254 views
  • 2 likes
  • 3 in conversation