Learn R Programming

nonrandom (version 1.42)

ps.estimate: Estimation of propensity score based treatment effects

Description

Estimation of propensity score based treatment effects

Usage

ps.estimate(object,resp,treat = NULL, stratum.index = NULL,
  match.index = NULL, adj = NULL, weights = "rr", family = "gaussian",
  regr = NULL, ...)

Arguments

object
an object of class 'stratified.pscore', 'stratified.data.frame', 'matched.pscore', 'matched.data.frame', 'matched.data.frames' or a data frame.
resp
an integer or a string indicating the outcome variable in the data and in the matched data if ps.match() is previously used.
treat
an integer or a string indicating the treatment variable in the data and in the matched data if ps.match() is previously used. If the class of the input object is 'stratified.pscore' or 'matched.pscore', no specification is ne
stratum.index
an integer or a string indicating the vector containing the stratum indices. No specification is needed if ps.makestrata() is previously used.
match.index
an integer or a string indicating the vector containing the matching indices. No specification is needed if ps.match() is previously used.
adj
a formula or a vector of integers or strings indicating covariates. The default is NULL, i.e. no additional adjustment for covariates is done in stratified or matched data. If adj is a formula, it must be formulated as 'outcome~tr
weights
a string indicating how to weight the stratum-specific estimates to obtain an overall estimate in case of stratified data. The default is 'rr' indicating stratum-specific weights proportional to the stratum-specific number of observations. In
family
a description of the error distribution and link function to be used in the model (see glm).
regr
a formula or a vector of integers or strings indicating covariates in data. The default is NULL, i.e. no regression model is fitted. If regr is a formula, it must be formulated as 'outcome~treatment+covariates' according to
...
further arguments passed to or from other methods.

Value

  • ps.estimate returns an object of the same class as the input object. The number and the manner of values depends on the scale of resp:
  • dataa data frame containing the input data.
  • data.matcheda data frame limiting 'data' only to matched observations. It is only available if ps.match() is previously used.
  • name.respa string indicating the name of the outcome variable.
  • respa numeric vector indicating the outcome variable labeled by 'name.resp'.
  • name.stratum.indexa string indicating the name of the selected stratum indices. It is only available if ps.makestrata() is previously used.
  • stratum.indexa numeric vector containing the selected stratum indices labeled by 'name.stratum.index'. It is only available if ps.makestrata() is previously used.
  • intervalsa vector of characters indicating the interval used for stratification. It is only available if ps.makestrata() is previously used.
  • stratified.bya string indicating the name of the selected stratification variable. It is only available if ps.makestrata() is previously used.
  • 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 propensity score estimated at last.
  • pscorea numeric vector containing the estimated propensity score labeled by 'name.pscore.
  • name.treata string indicating the name of the treatment variable.
  • treata numeric vector containing the treatment index labeled by 'name.treat'.
  • matched.bya string indicating the name of the selected matching variable. It is only available if ps.match() is previously used.
  • name.match.indexa string indicating the name of the selected matching indices. It is only available if ps.match() is previously used.
  • match.indexa numeric vector containing the selected matching indices labeled by 'name.match.index' whereas '0' indicates 'no matching partner found'. It is only available if ps.match() is previously used.
  • match.parametersa list of matching parameters including caliper, ratio, who.treated, givenTmatchingC and bestmatch.first. It is only available if ps.match() is previously used.
  • lr.estimationa list containing information about the regression model based treatment effect estimates. It correspond to the argument regr.

    [object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

  • ps.estimationa list containing information about the estimated propensity score based treatment effects. The list entries depend on the scale of outcome. [object Object],[object Object],[object Object],[object Object],[object Object]

Details

Propensity score methods are used to estimate treatment effects in observational data. The treatment effects are estimated without adjustment and can to be interpreted as marginal effects. However, it is additionally possible to adjust for residual imbalances in strata or in the matched data (using adj) and also to apply traditional regression (using regr).

The usage of ps.estimate() depends slightly on the class of the input object. If either ps.makestrata() or ps.match() are previously used, treat, match.index and stratum.index are not needed, contrary to the case where the input object is a data frame. If both match.index and stratum.index are specified, stratum.index will be ignored. If one specifies adj and regr as formulas, they must be identical in form of 'outcome~treatment+covariates' and 'outcome' and 'treatment' must agree with resp and treat.

See Also

glm, formula, lmer

Examples

Run this code
## STU1
data(stu1)
stu1.ps <- pscore(data    = stu1, 
                  formula = therapie~tgr+age)
stu1.match <- ps.match(object          = stu1.ps,
                       ratio           = 2,
                       caliper         = 0.5,
                       givenTmatchingC = FALSE,
                       matched.by      = "pscore",
                       setseed         = 38902)
stu1.est <-
  ps.estimate(object  = stu1.match,
              resp    = "pst",
              adj     = "tmass",
              regr    = pst~therapie+tgr+age)

## PRIDE
data(pride)
pride.ps <- pscore(data        = pride,
                   formula     = PCR_RSV~SEX+RSVINF+REGION+
                                 AGE+ELTATOP+EINZ+EXT,
                   name.pscore = "ps")
pride.strata <- ps.makestrata(object = pride.ps,
                              breaks = quantile(pride.ps$pscore,  
                                                seq(0,1,0.2)),
                              stratified.ps = "ps")
pride.est <-
  ps.estimate(object  = pride.strata,
              resp    = "SEVERE",
              family  = "binomial",
              adj     = "AGE",
              regr    = SEVERE ~PCR_RSV+SEX+ETHNO+FRUEHG+HERZ+
                        ELTATOP+REGION+AGE+TOBACCO+VOLLSTIL+EXT+
                        EINZ+KRANKSUM,
              weights = "rr")

Run the code above in your browser using DataLab