# SAS Code for the First Step

The joint model formulated in (12.6) can be fitted using the SAS procedure MIXED in the following way:

proc mixed data=dataset covtest; class endp patid trial;

model outcome = endp endp*treat*trial / S noint; repeated endp / type=un subject=patid(trial); ods output solutionF=eb CovParms=covar; run;

Note that the two-way interaction term endp*treat is dropped from the MODEL statement and instead we use the variable endp; as a result, a common intercept is fitted to the two endpoints. The panel in Figure 12.12 shows the parameter estimates for the first-stage model. The individual-level surro-

FIGURE 12.10

*Age-Related Macular Degeneration Trial. Estimation of trial-level surrogacy using a two-stage model. Trial-specific treatment effects obtained from the reduced fixed-effects model. Circle areas are proportional to trial size.*

gacy measure can be estimated using the residual covariance matrix shown in Figure 12.12,

The second-stage model, from which trial-level surrogacy is estimated, can be fitted in the same way as in Section (12.3.1).