we used becomes $w_{it}^f=w_{it}w_{it}^dw_{it}^r$. To stabilize the weights, the numerators of Equations \[chap3:w\_treat\], \[chap3:w\_miss\], and \[chap3:w\_death\] are replaced by the marginal probabilities of treatment, dropout, and death at baseline given by $$\prod_{j=1}^tP(Z_{ij}=z_{ij}|z_{i1},\ldots,z_{i,j-1},v_i;\mathbf{\tau}_j'),$$ $$\prod_{j=1}^tP(R_{ij}=r_{ij}|r_{i1},\ldots,r_{i,j-1},v_i;\mathbf{\gamma}_j'),$$ and $$\prod_{j=1}^tP(D_{ij}=d_{ij}|v_i;\mathbf{\lambda}_j')$$ respectively. We use the stabilized weights in our simulations and analysis.

Penalized Spline of Propensity Methods for Treatment Comparison
---------------------------------------------------------------

PENCOMP uses the same four assumptions made by MSM excluding Equation \[chap3:surv\_mod\] for confounding by indication problems. Full details of PENCOMP can be found in [@zhou_t]. We briefly describe the algorithm for PENCOMP using multiple imputation (MI) with longitudinal treatment assignments here. Without loss of generality, we assume no time-varying covariates in the data.

1.  For $b=1,\dots,B$, generate a bootstrap sample $S^{(b)}$ from the original data $S$ by sampling units with replacement, stratified on treatment group. For each sample $b$, carry out steps 2-7.

2.  Estimate a logistic regression model for the distribution of $Z_1$ given baseline covariates $V$ with regression parameters $\gamma_{z_1}$. Estimate the propensity to be assigned treatment $Z_1=z_1$ as $\hat{P}_{z_1}(V)=Pr(Z_1=z_1|V;\hat{\gamma}_{z_1}^b)$, where $\hat{\gamma}_{z_1}^b$ is the maximum likelihood (ML) estimate of $\gamma_{z_1}$. Define $\hat{P}^*_{z_1}=\log[\frac{\hat{P}_{z_1}(V)}{1-\hat{P}_{z_1}(V)}]$.

3.  Using the cases assigned to treatment group $Z_1=z_1$, estimate a normal linear regression of $Y_{z_1}$ on $V$, with mean 