View source: R/dsldConfounders.R
dsldFrequencyByS | R Documentation |
Informal assessment of C as a possible confounder in a relationship between a sensitive variable S and a variable Y.
dsldFrequencyByS(data, cName, sName)
data |
Data frame or equivalent. |
cName |
Name of the "C" column, an R factor. |
sName |
Name of the sensitive variable column, an R factor |
Essentially an informal assessment of the between S and C.
Consider the svcensus
dataset. If for instance we are studying
the effect of gender S on wage income Y, say C is occupation. If
different genders have different occupation patterns, then C is a
potential confounder. (Y does not explicitly appear here.)
Data frame, one for each level of the sensitive variable S, and one column for each level of the confounder C. Each row sums to 1.0.
N. Matloff, T. Abdullah, A. Ashok, J. Tran
data(svcensus)
dsldFrequencyByS(svcensus, cName = "educ", sName = "gender")
# not much difference in education between genders
dsldFrequencyByS(svcensus, cName = "occ", sName = "gender")
# substantial difference in occupation between genders
data(lsa)
lsa$faminc <- as.factor(lsa$fam_inc)
dsldFrequencyByS(lsa,'faminc','race1')
# distribution of family income by race
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.