data(drug.consumption)
# short-hand variable names.
r = drug.consumption[, "Meth"]
s = drug.consumption[, c("Age", "Gender", "Race")]
p = drug.consumption[, c("Education", "Nscore", "Escore", "Oscore", "Ascore",
"Cscore", "Impulsive", "SS")]
# collapse levels with low observed frequencies.
levels(p$Education) =
c("at.most.18y", "at.most.18y", "at.most.18y", "at.most.18y", "university",
"diploma", "bachelor", "master", "phd")
if (FALSE) {
m = fgrrm(response = r, sensitive = s, predictors = p, ,
family = "multinomial", unfairness = 0.05)
summary(m)
HH = drug.consumption$Heroin
levels(HH) = c("Never Used", "Used", "Used", "Used", "Used Recently",
"Used Recently", "Used Recently")
m = fgrrm(response = HH, sensitive = s, predictors = p, ,
family = "multinomial", unfairness = 0.05)
summary(m)
}
Run the code above in your browser using DataLab