Learn R Programming

nonrandom (version 1.42)

pscore: Propensity score estimation

Description

Estimate the propensity score using a logistic regression model

Usage

pscore(formula, data, family="binomial", na.action=na.exclude,
  name.pscore="pscore", ...)

Arguments

formula
an object of class 'formula' (or one that can be coerced to that class): a symbolic description of a model to be fitted. The outcome given in formula must be labeled with '0' and '1' due to the internal use of glm.
data
a data frame containing outcome and treatment variable and covariates.
family
the error distribution and link function to be used in the model (see glm). The default is 'binomial'.
na.action
a function which indicates what should happen when data contain 'NA's. The default is 'na.exclude', i.e., data containing 'NA' values are deleted (see na.exclude).
name.pscore
a string indicating the name of the estimated propensity score.
...
further arguments passed to or from other methods.

Value

  • pscore returns an object of class 'pscore' containing the following components:
  • dataa data frame containing the input data, extended by column(s) including the estimated propensity score(s) labeled by name.pscore.
  • formula.pscorea formula describing formally the propensity score model fitted at last.
  • model.pscorean object of class glm containing information about the propensity score model fitted at last.
  • name.pscorea string indicating the name of the propensity score estimated at last.
  • pscorea numeric vector containing the estimated propensity score fitted at last and labeled by 'name.pscore'.
  • name.treata string indicating the name of the treatment variable given in formula as outcome.
  • treata numeric vector containing the treatment labeled by 'name.treat'.

Details

The propensity score is the conditional probability of receiving a certain treatment given patient's covariates. It is generally unknown and has to be estimated, e.g. by using logistic regression. pscore can be used repeatedly and all estimated propensity scores are added on 'data'. But only the information of the propensity score estimated at last will be stored in values of the output object.

See Also

glm, formula

Examples

Run this code
## STU1
data(stu1)
stu1.ps <- pscore(data    = stu1, 
                  formula = therapie~tgr+age)


## PRIDE
data(pride)
pride.ps <- pscore(data        = pride,
                   formula     = PCR_RSV~SEX+RSVINF+REGION+
                                 AGE+ELTATOP+EINZ+EXT,
                   name.pscore = "ps")

Run the code above in your browser using DataLab