ps.regression: Outcome Regression Model

Description Usage Arguments Details Value Examples

View source: R/psOutcome.R

Description

Fits a regression model to the specified outcome variable

Usage

1
2
ps.regression(data, outcome, covariates = character(), family = binomial(),
  w = NULL)

Arguments

data

Data frame, containing the dataset to be analyzed. The data frame must contain a treatment indicator variable called 'treat' and propensity score values called 'ps_values'.

outcome

String, containing the outcome variable name to be analyzed

covariates

Vector, containing the set of covariate variable names to include in the regression

family

Model family, passed through to glm. Defaults to binomial() - see ?glm for additional documentation

w

Vector, containing the subject weights. Defaults to equally weighted. If analysis of matched data is desired, set this value to myData$is_matched.

Details

This function uses the glm package to fit a regression model to the specified outcome variable. By default, the regression model will fit outcome ~ treat + ps_values. Inclusion of the PS values in the outcome model is recommended by literature producing a "doubly robust" analysis. In addition, any unbalanced covariates be included in the vector of covariate names parameter. These will also be included in the regression model. Weights for the regression model can be specified, or default to use the calculated weights in the data frame.

Value

Object, containing fitted model values. In addition to standard glm/lm output, the treatment effect is appended to the model object as model$treatment.effect. For dichotomous outcome variables, this is the odds ratio with confidence interval.

Examples

1
2
3
4
5
## Not run: 
ps.regression(myData, "outcome")
ps.regression(myData, "outcome", covariates, w = myData$is_matched)

## End(Not run)

OHDSI/Centaur documentation built on May 9, 2017, 3:24 p.m.