- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello. I would like to run a fisher's exact test. However, my data is weighted so I am using proc surveyfreq to obtain p-values for my contingency tables. The exact option will not work with the proc surveyfreq command. Any suggestions?
I should also add that one of my cells is 0. The nosparse option can suppress the cell but I still cannot get a p-value with the chisq option.
Thank you.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
When there's an empty (zero-frequency) table cell, the Rao-Scott chi-square can't be computed because some quantities are undefined/missing. Here's one possible work-around, if you want to use zero as the standard error for the missing cell(s).
1) Construct a data set that contains one observation for each empty table cell, and assign a small weight (relative to the real survey weights) to each of these observations -- e.g., 1e-8.
2) Merge that data set with the analysis dataset. Because of the very small weights, the additional observations should not affect the estimates of proportions and totals. But all table cells will have positive frequency and SURVEYFREQ will compute the Rao-Scott chi-square test.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I don't think that there is such a thing as Fisher's Exact test for survey data, as the existence of the survey weights means you aren't dealing with integers in the analysis, which is what Exact tests require (but shhhh don't tell Sir Ronald)
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Yes, that is the error message that I am getting from SAS. @PaigeMiller do you know any solution for getting a p-value with survey data when one of the cells is 0?
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
PROC SURVEYFREQ has other ways to obtain confidence intervals. There are many choices within the CL option in PROC SURVEYFREQ.
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
When there's an empty (zero-frequency) table cell, the Rao-Scott chi-square can't be computed because some quantities are undefined/missing. Here's one possible work-around, if you want to use zero as the standard error for the missing cell(s).
1) Construct a data set that contains one observation for each empty table cell, and assign a small weight (relative to the real survey weights) to each of these observations -- e.g., 1e-8.
2) Merge that data set with the analysis dataset. Because of the very small weights, the additional observations should not affect the estimates of proportions and totals. But all table cells will have positive frequency and SURVEYFREQ will compute the Rao-Scott chi-square test.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content