Help using Base SAS procedures

how to perform ANOVA with proc surveymeans?

Reply
N/A
Posts: 1

how to perform ANOVA with proc surveymeans?

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! 

Respected Advisor
Posts: 2,655

Re: how to perform ANOVA with proc surveymeans?

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

Ask a Question
Discussion stats
  • 1 reply
  • 706 views
  • 0 likes
  • 2 in conversation