Programming the statistical procedures from SAS

How Do I Calculate Weighted Confidence Intervals in Proc SurveyFreq

Reply
New Contributor
Posts: 3

How Do I Calculate Weighted Confidence Intervals in Proc SurveyFreq

[ Edited ]

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
schtypeVaccineFrequencyWeighted FrequencyStd Dev of Wgt Freq95% Confidence Limits for Wgt Freq (Lower)95% Confidence Limits for Wgt Freq (Upper)Percent Std Err of Percent   
        
 Public04732692218.49023226431207.29230.5724    
 1688731931639.46982306773318486.49120.6255    
 Total736034623660.26749333293591793.78350.2812    
 Private041116.3499123.4281770.42485162.274980.31520.0637    
 1903217992.61625199723605.90130.2725    
 Total944229595.21339210824826.21650.2812    
Total05142809219.57097237832397.60740.5752    
 1779034109633.0423328693535092.39260.5752    
 Total830436918652.593853563938197100     

 

Thank you for taking the time to read and please let me know if anything comes to mind.

Attachment
Grand Advisor
Posts: 10,081

Re: How Do I Calculate Weighted Confidence Intervals in Proc SurveyFreq

Did you try the option CL ?

New Contributor
Posts: 3

Re: How Do I Calculate Weighted Confidence Intervals in Proc SurveyFreq

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.

 

schooltypevaccineFrequencyWeighted FrequencyStd Dev of Wgt FreqPercentStd Err of Percent95% Confidence Limits for Percent (Lower) 95% Confidence Limits for Percent (Upper)
 04732692218.490237.29230.57246.17028.4144
 1688731931639.4698286.49120.625585.265187.717
 Total736034623660.2674993.78350.281293.232494.335
 041116.3499123.428170.31520.06370.19030.44
 1903217992.616255.90130.27255.36716.4356
 Total944229595.213396.21650.28125.66536.7676
Total05142809219.570977.60740.57526.47998.735
 1779034109633.042392.39260.575291.26593.52
 Total830436918652.59385100   
Ask a Question
Discussion stats
  • 2 replies
  • 282 views
  • 0 likes
  • 2 in conversation