10-04-2016 12:04 PM - edited 10-04-2016 02:18 PM
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;
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|
Thank you for taking the time to read and please let me know if anything comes to mind.
10-04-2016 12:39 PM
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)|