Repository navigation
Changed disclosure checks to include NAs for cross-tabulations. - #456
anarchodoc wants to merge 1 commit into
Conversation
|
I think we should not include the number of NAs in the disclosure trap for the tables because this would block the display of all tables where the actual variable has only a few NAs but the other categories have sufficient observations. This is common in many cohort data. One possible solution for this issue would be to prevent the convertion of any values to NAs. This would require adding a disclosure trap to ds.recodeValues. |
davraam
left a comment
There was a problem hiding this comment.
I think we should not include the number of NAs in the disclosure trap for the tables because this would block the display of all tables where the actual variable has only a few NAs but the other categories have sufficient observations. This is common in many cohort data. One possible solution for this issue would be to prevent the convertion of any values to NAs. This would require adding a disclosure trap to ds.recodeValues.
|
Thanks |
|
Respectfully, I disagree: the change effectively treats NA as a category, the same as any other. If there are only 1 or 2 NAs, this is potentially disclosive in exactly the same way as a variable with 2 or 3 categories does not permit having one of those categories with [below the filter trap] number of subjects. I agree there are many cohorts that have some missing data, but if they're large enough, it's likely to be more than just 1 or 2 subjects (i.e. less than a filter trap of below 3) with missing data, hence will not have such a great impact. |
This PR is to fix a disclosure bug whereby a table value below the threshold can be converted to NA and then identified. The fix entails including the NAs in the disclosure test.
In the following example, there's a variable ('sex_bin') which cannot be read as at least one of the categories has a value below the filter value (3):
So, recode the variable (I know it has 3 categories: 1,2,9 - and here I suspect 9 might be the suspect category):
Then, we can cross-tabulate the two variables - and it works! Look at this:
Now we clearly see that there were some individuals such that n was below the filter value (3) but these don't get picked up by the filter trap as they are now in the NA column. Specifically, there are 2 in COHORT1, 2 in COHORT2 and 1 in COHORT3 - giving a total of 5 subjects with value 9 in the original variable.