turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- SAS Procedures
- /
- how to perform ANOVA with proc surveymeans?

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

05-30-2012 06:02 PM

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!

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

05-31-2012 07:45 AM

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