pscore: Propensity score estimation

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/pscore.R

Description

Estimate the propensity score using a logistic regression model

Usage

1
2
  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.

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.

Value

pscore returns an object of class 'pscore' containing the following components:

data

a data frame containing the input data, extended by column(s) including the estimated propensity score(s) labeled by name.pscore.

formula.pscore

a formula describing formally the propensity score model fitted at last.

model.pscore

an object of class glm containing information about the propensity score model fitted at last.

name.pscore

a string indicating the name of the propensity score estimated at last.

pscore

a numeric vector containing the estimated propensity score fitted at last and labeled by 'name.pscore'.

name.treat

a string indicating the name of the treatment variable given in formula as outcome.

treat

a numeric vector containing the treatment labeled by 'name.treat'.

Author(s)

Susanne Stampf susanne.stampf@usb.ch

See Also

glm, formula

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## 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")

Example output

Loading required package: lme4
Loading required package: Matrix

nonrandom documentation built on May 29, 2017, 11:41 p.m.