$$\label{chap3:pencomp}
            E(Y_{z_1}|V,Z_1=z_1,\theta_{z_1},\beta_{z_1})=s(\hat{P}^*_{z_1}|\theta_{z_1})+g_{z_1}(\hat{P}^*_{z_1},V;\beta_{z_1}),$$ where $s(\hat{P}*_{z_1}|\theta_{z_1})$ denotes a penalized spline with fixed knots and parameters $\theta_{z_1}$ and $g_{z_1}(.)$ represents a parametric function of other predictors of the outcome, indexed by parameters $\beta_{z_1}$. One of the covariates might be omitted to avoid collinearity in the covariates in Equation \[chap3:pencomp\].

4.  For $z_1=0,1$, impute the values of $Y_{z_1}$ for subjects in treatment group $1-z_1$ in the original data with draws from the predictive distribution of $Y_{z_1}$ given $V$ from the regression in Step 3, with the ML estimates $\hat{\theta}_{z_1}^{(b)},\hat{\beta}_{z_1}^{(b)}$ substituted for the parameters $\theta_{z_1}^{(b)},\beta_{z_1}^{(b)}$.

5.  Estimate a logistic regression model for the distribution of $Z_2$ given $V,Z_1,(Y_0,Y_1)$, with regression parameters $\gamma_{z_2}$ and missing values of $(Y_0,Y_1)$ imputed from Step 4. Estimate the propensity to be assigned treatment $Z_2=z_2$ given $Z_1$, $Y_{Z_1}$, and $V$ as $\hat{P}_{z_2}(Z_1,Y_{Z_1},V)=Pr(Z_2=z_2|Z_1=z_1,Y_{z_1},V;\hat{\gamma}_{z_2}^{(b)})$, where $\hat{\gamma}_{z_2}^{(b)}$ is the ML estimate of $\gamma_{z_2}$. The probability of treatment regimen $(Z_1=z_1,Z_2=z_2)$ is denoted as $\hat{P}_{z_1z_2}=\hat{P}_{z_1}(V)\hat{P}_{z_2}(Z_1,Y_{Z_1},V)$, and define $\hat{P}^*_{z_1,z_2}=\log[\frac{\hat{P}_{z_1z_2}}{1-\hat{P}_{z_1z_2}}]$.

6.  Using the cases assigned to treatment group $(z_1,z_2)$, estimate a normal linear regression of $Y_{z_1,z_2}$ on $Z_2$, $Z_1$, $Y_{Z_1}$, and $V$ with mean [ $$\label{chap3:pencomp2}
            E(Y_{z_1,z_2}|V,Y_{z_1},Z_1=z_1,Z_1=z_2,\theta_{z_1,z_2},\beta_{z_1,z_2})=s(\hat{P}^*_{z_1,z_2}|\theta_{z_1,z_2})+g_{z_1,z_2}(\hat{P}^*_{z_1,z_2},Z_2,Z_1,Y_{Z_1},V;\beta_{z_1,z_2}).$$ ]{}

7.  For each combination of $(z_1,z_2)$ impute the values of $Y_{z_1,z_2}$ for subjects not assigned this treatment combination in the 