Unlimited learning, half price | 50% off

Last chance! 50% off unlimited learning

Sale ends in


CBPS (version 0.8)

MSMdata: Marginal Structural Model Data Generator

Description

MSMdata simulates data to be fit with a marginal structural model

Usage

MSMdata(n)

Arguments

n
The desired sample size.

Value

  • Returns an object with the following:
  • treat.1, treat.2, treat.3The observed binary treatment at times 1, 2, and 3.
  • X1, X2, X3Covariate matrices for times 1, 2, and 3. The last column is the previous observed treatment vector.
  • probs.joint, probs.uncondThe true joint probabilities and unconditional for each treatment sequence, of length n. The true (stabilized) marginal structural weights are the unconditional probabilities divided by the joint probabilities.
  • yThe outcome, of length n.
  • n.tNumber of unique time values

Details

MSMdata simulates data to be fit with a marginal structural model

References

Imai, Kosuke and Marc Ratkovic

See Also

CBPS

Examples

Run this code
##Generates a dataset with 100 observations.
data1<-MSMdata(100)

Run the code above in your browser using DataLab