dsldFrequencyByS: dsldFrequencyByS

View source: R/dsldConfounders.R

dsldFrequencyBySR Documentation

dsldFrequencyByS

Description

Informal assessment of C as a possible confounder in a relationship between a sensitive variable S and a variable Y.

Usage

dsldFrequencyByS(data, cName, sName)

Arguments

data

Data frame or equivalent.

cName

Name of the "C" column, an R factor.

sName

Name of the sensitive variable column, an R factor

Details

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.)

Value

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.

Author(s)

N. Matloff, T. Abdullah, A. Ashok, J. Tran

Examples

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

dsld documentation built on Sept. 14, 2024, 1:08 a.m.