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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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