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;
var vary varx;
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!
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;
var vary varx;
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.
04-03-2018 05:24 AM
SteveDenham is correct that you can perform ANOVA with PROC SURVEYREG. You can do this by specifying ANOVA as an option in the MODEL statement. You can see that here: https://support.sas.com/documentation/cdl/en/statug/63347/HTML/default/viewer.htm#statug_surveyreg_s...
here is an example:
PROC SURVEYREG DATA=ZZ_Final2;
MODEL PctOfTotalSugrFromSSBs = FSDHH / ANOVA;