Hello everyone. I'm working on analysis of a dataset in SAS 9.3 and have come across a bit of a bump.
I'm analyzing weighted individual-level immunization data to determine statistical differences in two populations. The variable of interest is whether or not the individual is up-to-date for a specific vaccine, which is coded as either a 1 (up-to-date) or 0 (not up-to-date). Each person is coded into groups, like the type of school which the child attends (public=1 versus private=2). I am trying to find out if there are significant differences in vaccination coverage between the two populations using a proc surveyfreq statement. Below is an example of the code I've been running:
proc surveyfreq data = samplecode;
tables schooltype*vaccine /chisq clwt;
weight finalweight;
run;
where schooltype is the type of school which the child attends, vaccine is the vaccine up-to-date status, and finalweight is the calculated weight for each data point. Pretty basic.
Running the proc surveyfreq does give me the significance testing I'm looking for, but I'm stuck on getting the confidence intervals for the weighted percent. The CLWT statement gives me the weighted frequency for each item, but does not really give me the denominator.
I'm confused as to whether or not I should be using the 95% confidence limits for the weighted frequency (red font in the table below) and dividing that by the weighted frequency for the total (blue font in the table below) or if it should be done as a factor of dividing it by the 95% confidence limits for the weighted frequency of the total (green font in the table below), if that makes sense. I have included the output from my proc surveyfreq, if that helps. Or is there a better way to get the weighted confidence interval percentages that I'm not thinking of? I have attached a cutout of the database (samplecode.sas7bdat) I've been using, if what I'm saying isn't making any sense.
Table of schooltype by vaccine | ||||||||||||
schtype | Vaccine | Frequency | Weighted Frequency | Std Dev of Wgt Freq | 95% Confidence Limits for Wgt Freq (Lower) | 95% Confidence Limits for Wgt Freq (Upper) | Percent | Std Err of Percent | ||||
Public | 0 | 473 | 2692 | 218.49023 | 2264 | 3120 | 7.2923 | 0.5724 | ||||
1 | 6887 | 31931 | 639.46982 | 30677 | 33184 | 86.4912 | 0.6255 | |||||
Total | 7360 | 34623 | 660.26749 | 33329 | 35917 | 93.7835 | 0.2812 | |||||
Private | 0 | 41 | 116.34991 | 23.42817 | 70.42485 | 162.27498 | 0.3152 | 0.0637 | ||||
1 | 903 | 2179 | 92.61625 | 1997 | 2360 | 5.9013 | 0.2725 | |||||
Total | 944 | 2295 | 95.21339 | 2108 | 2482 | 6.2165 | 0.2812 | |||||
Total | 0 | 514 | 2809 | 219.57097 | 2378 | 3239 | 7.6074 | 0.5752 | ||||
1 | 7790 | 34109 | 633.0423 | 32869 | 35350 | 92.3926 | 0.5752 | |||||
Total | 8304 | 36918 | 652.59385 | 35639 | 38197 | 100 |
Thank you for taking the time to read and please let me know if anything comes to mind.
Did you try the option CL ?
Hello and thanks for your input.
Yes, I did try CL as a method, but it only creates confidence limits for the percentage without the weights, as seen below.
schooltype | vaccine | Frequency | Weighted Frequency | Std Dev of Wgt Freq | Percent | Std Err of Percent | 95% Confidence Limits for Percent (Lower) | 95% Confidence Limits for Percent (Upper) |
0 | 473 | 2692 | 218.49023 | 7.2923 | 0.5724 | 6.1702 | 8.4144 | |
1 | 6887 | 31931 | 639.46982 | 86.4912 | 0.6255 | 85.2651 | 87.717 | |
Total | 7360 | 34623 | 660.26749 | 93.7835 | 0.2812 | 93.2324 | 94.335 | |
0 | 41 | 116.34991 | 23.42817 | 0.3152 | 0.0637 | 0.1903 | 0.44 | |
1 | 903 | 2179 | 92.61625 | 5.9013 | 0.2725 | 5.3671 | 6.4356 | |
Total | 944 | 2295 | 95.21339 | 6.2165 | 0.2812 | 5.6653 | 6.7676 | |
Total | 0 | 514 | 2809 | 219.57097 | 7.6074 | 0.5752 | 6.4799 | 8.735 |
1 | 7790 | 34109 | 633.0423 | 92.3926 | 0.5752 | 91.265 | 93.52 | |
Total | 8304 | 36918 | 652.59385 | 100 |
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.