relative.effect: Relative effects of covariates

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

View source: R/relative.effect.R

Description

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

Usage

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

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.

Value

relative.effect returns a list containing the following components:

unadj.treat

the estimated unadjusted treatment effect on outcome.

adj.treat.cov

a vector containing the estimated treatment effects on outcome, individually adjusted for the selected covariates.

rel.treat

a vector containing the relative effect for each covariate.

name.treat

a string indicating the name of the treatment.

name.resp

a string indicating the name of the outcome.

name.sel

a vector of strings indicating the names of the selected covariates.

family

the error distribution and link function used in the model (see glm).

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
13
## 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)

Example output

Loading required package: lme4
Loading required package: Matrix

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