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