dsldLinear | R Documentation |
Comparison of sensitive groups via linear models, with or without interactions with the sensitive variable.
dsldLinear(data, yName, sName, interactions = FALSE, sComparisonPts = NULL,
useSandwich = FALSE)
## S3 method for class 'dsldLM'
summary(object,...)
## S3 method for class 'dsldLM'
predict(object,xNew,...)
## S3 method for class 'dsldLM'
coef(object,...)
## S3 method for class 'dsldLM'
vcov(object,...)
data |
Data frame. |
yName |
Name of the response variable Y column. |
sName |
Name of the sensitive attribute S column. |
interactions |
Logical value indicating whether or not to model interactions with the sensitive variable S. |
sComparisonPts |
If |
useSandwich |
If TRUE, use the "sandwich" variance estimator. |
object |
An object returned by the |
xNew |
New data to be predicted. Must be in the same format as original data. |
... |
Further arguments. |
The dsldLinear
function fits a linear model to the response
variable Y using all other variables in data
. The user may
select for interactions with the sensitive variable S.
The function produces an instance of the 'dsldLM' class (an S3
object). Instances of the generic functions summary
and
coef
are provided.
If interactions
is TRUE, the function will fit m separate
models, where m is the number of levels of S. Then summary
will contain m+1 data frames; the first m of which will be the
outputs from the individual models.
The m+1st data frame will compare the differences
in conditional mean Y|X for each pair of S levels, and for each
value of X in sComparisonPts
.
The intention is to allow users to see the comparisons
of conditions for sensitive groups via linear models, with
interactions with S.
The dsldDiffS
function allows users to compare mean Y at that
X between each pair of S level for additional new unseen data levels
using the model fitted from dsldLinear
.
The dsldLinear
function returns an S3 object of class 'dsldLM',
with one component for each level of S. Each component includes
information about the fitted model.
N. Matloff, A. Mittal, A. Ashok
data(svcensus)
newData <- svcensus[c(1, 18), -c(4,6)]
lin1 <- dsldLinear(svcensus, 'wageinc', 'gender', interactions = TRUE,
newData)
coef(lin1)
vcov(lin1)
summary(lin1)
predict(lin1, newData)
lin2 <- dsldLinear(svcensus, 'wageinc', 'gender', interactions = FALSE)
summary(lin2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.