dsldLogit: dsldLogit

View source: R/dsldLogit.R

dsldLogitR Documentation

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 class 'dsldGLM'
summary(object,...)
## S3 method for class 'dsldGLM'
predict(object,xNew,...)
## S3 method for class 'dsldGLM'
coef(object,...)
## S3 method for class 'dsldGLM'
vcov(object,...)

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.

Details

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

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.

Author(s)

N. Matloff, A. Mittal, A. Ashok

Examples


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)

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