Learn R Programming

CBPS (version 0.8)

balance.CBMSM: Optimal Covariate Balance for Marginal Structural Models

Description

Returns the mean and standardized mean associated with each treatment group, before and after weighting.

Usage

## S3 method for class 'CBMSM':
balance(object, stabilized, ...)

Arguments

object
A CBMSM object.
stabilized
Set to TRUE to use stabilized weights, and FALSE to use unstabilized weights. Default is TRUE.
...
Additional arguments to be passed to balance.

Value

  • Returns a list whose elements are lists associated with each time step in the marginal structural model. Each of the sublists has two matrices, "original" (before weighting) and "balanced" (after weighting).

Details

Each of the matrices' rows are the covariates and whose columns are the weighted mean, and standardized mean associated with each treatment group. The standardized mean is the weighted mean divided by the standard deviation of the covariate for the whole population.

Examples

Run this code
###
### Example: Optimal Covariate Balance
###
data1<-MSMdata(200)
attach(data1)
formulas.msm<-list(c(treat.1~X1, treat.2~X2, treat.3~X3))
msm1<-CBPS(formulas.msm,method="over",type="MSM")
balance(msm1)
detach(data1)

Run the code above in your browser using DataLab