I am analyzing complex survey data using proc surveyfreq in SAS 9.4. I have produced a crosstab table using the following code:
proc surveyfreq data=analysis missing nosummary;
table var1*var2/ row CVWT;
weight new_weight;
run;
According to the SAS User's Guide, the coefficients of variation for weighted frequencies (CVWT) is calculated from the table as follows:
For the total in table cell , the coefficient of variation is computed as
where is the estimate of the total in table cell and is the standard error of the estimate.
I want to manually calculate the CVWT from the raw data. How do I do this?
Note1: I have tried Sqrt((1 - p) / np) using the new_weight variable but no luck i.e. doesn't match the CVWT in the SAS output.
Note2: The reason for wanting to do this is allow users to explore any combination of the survey variables in Tableau and display the weighted frequencies along with the appropriate CV (calculated on the fly).
Thanks for any insight you can offer!
Solved.
Ensure you calculate the standard deviation of the SUM of the weighted frequencies and not the standard deviation of the mean.
stdev(Xsum) = sqrt(N) * stdev(X)
The formula from the SAS User's guide can then be used to calculate the CVWT.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.