\begin{knitrout}
\definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}\begin{kframe}
\begin{alltt}
\hlstd{fit.or2}\hlkwb{<-}\hlkwd{lm}\hlstd{(Y}\hlopt{~}\hlstd{Z}\hlopt{+}\hlstd{Z}\hlopt{:}\hlstd{X1}\hlopt{+}\hlstd{Z}\hlopt{:}\hlstd{X2}\hlopt{+}\hlstd{Z}\hlopt{:}\hlstd{X1}\hlopt{:}\hlstd{X2)}
\hlkwd{round}\hlstd{(}\hlkwd{coef}\hlstd{(}\hlkwd{summary}\hlstd{(fit.or2)),}\hlnum{6}\hlstd{)}
\end{alltt}
\begin{verbatim}
+              Estimate Std. Error    t value Pr(>|t|)
+ (Intercept)  4.288448   0.012557 341.526494        0
+ Z            6.761074   0.212130  31.872303        0
+ Z:X1        -1.040222   0.146840  -7.084072        0
+ Z:X2         2.221214   0.074149  29.956267        0
+ Z:X1:X2      1.583540   0.059604  26.567677        0
\end{verbatim}
\begin{alltt}
\hlstd{mu0.or2}\hlkwb{<-}\hlkwd{mean}\hlstd{(}\hlkwd{predict}\hlstd{(fit.or2,}\hlkwc{newdata}\hlstd{=}\hlkwd{data.frame}\hlstd{(X1,X2,}\hlkwc{Z}\hlstd{=}\hlnum{0}\hlstd{)))}
\hlstd{mu1.or2}\hlkwb{<-}\hlkwd{mean}\hlstd{(}\hlkwd{predict}\hlstd{(fit.or2,}\hlkwc{newdata}\hlstd{=}\hlkwd{data.frame}\hlstd{(X1,X2,}\hlkwc{Z}\hlstd{=}\hlnum{1}\hlstd{)))}
\hlkwd{c}\hlstd{(mu0.or2,mu1.or2,mu1.or2}\hlopt{-}\hlstd{mu0.or2)}
\end{alltt}
\begin{verbatim}
+ [1]  4.288448  2.539963 -1.748485
\end{verbatim}
\end{kframe}
\end{knitrout}