Learn R Programming

dsld (version 0.2.2)

dsldLogit: dsldLogit

Description

Comparison of conditions for sensitive groups via logistic regression models, with or without interactions with the sensitive variable.

Usage

dsldLogit(data, yName, sName, sComparisonPts = NULL, interactions = FALSE, 
   yesYVal)
# S3 method for dsldGLM
summary(object,...)
# S3 method for dsldGLM
predict(object,xNew,...)
# S3 method for dsldGLM
coef(object,...)
# S3 method for dsldGLM
vcov(object,...)

Value

The dsldLog function returns an S3 object of class 'dsldGLM', with one component for each level of S. Each component includes information about the fitted model.

Arguments

data

Data frame used to train the linear model; will be split according to each level of sName in output if interactions is TRUE.

yName

Name of the response variable column.

sName

Name of the sensitive attribute column.

interactions

If TRUE, fit interactions with the sensitive variable.

sComparisonPts

If interactions is TRUE, a a data frame of new cases (minus Y,S) for which P(Y = 1| X) will be compared between each pairs of S levels. Must be in the same format as the original data.

yesYVal

Y value to be considered 'yes', to be coded 1 rather than 0.

object

An object returned by dsldLogit.

xNew

Dataframe to predict new cases. Must be in the same format as data.

...

Further arguments.

Author

N. Matloff, A. Mittal, A. Ashok

Details

The dsldLogit function fits a logistic regression model to the response variable. Interactions are handled as in dsldLinear.

Examples

Run this code

data(lsa)
newData <- lsa[c(2,22,222,2222),-c(8,11)]
log1 <- dsldLogit(lsa,'bar','race1', newData, interactions = TRUE, 'TRUE')

coef(log1)
vcov(log1) 
summary(log1) 
predict(log1, newData)
            
log2 <- dsldLogit(data = lsa,
    yName = 'bar',sName = 'gender', 
    interactions = FALSE, yesYVal = 'TRUE')
summary(log2)

Run the code above in your browser using DataLab