Learn R Programming

nonrandom (version 1.42)

relative.effect: Relative effects of covariates

Description

Estimate the extent to which a covariate is confounding the treatment effect

Usage

relative.effect(formula=NULL, data, sel=NULL, resp=NULL, treat=NULL, ...)

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.
data
a data frame containing outcome, treatment and covariates.
sel
a vector of integers or strings indicating the covariates.
resp
an integer or a string indicating the outcome variable.
treat
an integer or a string indicating the treatment variable.
...
further arguments passed to or from other methods.

Value

  • relative.effect returns a list containing the following components:
  • unadj.treatthe estimated unadjusted treatment effect on outcome.
  • adj.treat.cova vector containing the estimated treatment effects on outcome, individually adjusted for the selected covariates.
  • rel.treata vector containing the relative effect for each covariate.
  • name.treata string indicating the name of the treatment.
  • name.respa string indicating the name of the outcome.
  • name.sela vector of strings indicating the names of the selected covariates.
  • familythe error distribution and link function used in the model (see glm).

Details

The decision about the inclusion of covariates in the propensity score model is mostly difficult. A measure describing the extent to which a covariate is confounding the treatment effect on outcome can help to decide on it. Covariates with a large impact are potential candidates for the propensity score model.

The relative effect is defined as difference between adjusted and unadjusted treatment effect related to the unadjusted effect (per cent). Therefore, treatment effects on outcome, unadjusted and adjusted for covariates, are estimated using internally glm.

Two options are available to fit appropriate regression models. Either a formula is specified, typically as 'resp ~ treat + cov' (formula), or resp, treat and sel are given to specify the outcome and treatment variable and the covariates.

See Also

glm, formula

Examples

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

## PRIDE
data(pride)
pride.effect <- 
  relative.effect(data = pride,
                  sel = c(2:14),
                  resp = 15,
                  treat = 1)

Run the code above in your browser using DataLab