\documentclass[a4paper,inpress]{jdsart}

\setcounter{page}{1}
\pubmonth{July}
\pubyear{2020}
\volume{xx}
\issue{xx}
\doi{0000}

\usepackage{color}
\usepackage{fancyvrb}
\newcommand{\VerbBar}{|}
\newcommand{\VERB}{\Verb[commandchars=\\\{\}]}
\DefineVerbatimEnvironment{Highlighting}{Verbatim}{commandchars=\\\{\}}
% Add ',fontsize=\small' for more characters per line
\usepackage{framed}
\definecolor{shadecolor}{RGB}{248,248,248}
\newenvironment{Shaded}{\begin{snugshade}}{\end{snugshade}}
\newcommand{\AlertTok}[1]{\textcolor[rgb]{0.94,0.16,0.16}{#1}}
\newcommand{\AnnotationTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}}
\newcommand{\AttributeTok}[1]{\textcolor[rgb]{0.77,0.63,0.00}{#1}}
\newcommand{\BaseNTok}[1]{\textcolor[rgb]{0.00,0.00,0.81}{#1}}
\newcommand{\BuiltInTok}[1]{#1}
\newcommand{\CharTok}[1]{\textcolor[rgb]{0.31,0.60,0.02}{#1}}
\newcommand{\CommentTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textit{#1}}}
\newcommand{\CommentVarTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}}
\newcommand{\ConstantTok}[1]{\textcolor[rgb]{0.00,0.00,0.00}{#1}}
\newcommand{\ControlFlowTok}[1]{\textcolor[rgb]{0.13,0.29,0.53}{\textbf{#1}}}
\newcommand{\DataTypeTok}[1]{\textcolor[rgb]{0.13,0.29,0.53}{#1}}
\newcommand{\DecValTok}[1]{\textcolor[rgb]{0.00,0.00,0.81}{#1}}
\newcommand{\DocumentationTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}}
\newcommand{\ErrorTok}[1]{\textcolor[rgb]{0.64,0.00,0.00}{\textbf{#1}}}
\newcommand{\ExtensionTok}[1]{#1}
\newcommand{\FloatTok}[1]{\textcolor[rgb]{0.00,0.00,0.81}{#1}}
\newcommand{\FunctionTok}[1]{\textcolor[rgb]{0.00,0.00,0.00}{#1}}
\newcommand{\ImportTok}[1]{#1}
\newcommand{\InformationTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}}
\newcommand{\KeywordTok}[1]{\textcolor[rgb]{0.13,0.29,0.53}{\textbf{#1}}}
\newcommand{\NormalTok}[1]{#1}
\newcommand{\OperatorTok}[1]{\textcolor[rgb]{0.81,0.36,0.00}{\textbf{#1}}}
\newcommand{\OtherTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{#1}}
\newcommand{\PreprocessorTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textit{#1}}}
\newcommand{\RegionMarkerTok}[1]{#1}
\newcommand{\SpecialCharTok}[1]{\textcolor[rgb]{0.00,0.00,0.00}{#1}}
\newcommand{\SpecialStringTok}[1]{\textcolor[rgb]{0.31,0.60,0.02}{#1}}
\newcommand{\StringTok}[1]{\textcolor[rgb]{0.31,0.60,0.02}{#1}}
\newcommand{\VariableTok}[1]{\textcolor[rgb]{0.00,0.00,0.00}{#1}}
\newcommand{\VerbatimStringTok}[1]{\textcolor[rgb]{0.31,0.60,0.02}{#1}}
\newcommand{\WarningTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}}

\usepackage[utf8]{inputenc}
\providecommand{\tightlist}{%
  \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}


\usepackage{amsfonts,amsmath,amssymb,amsthm} \usepackage{booktabs} \usepackage{subcaption} \usepackage{tabularx} \usepackage{fancyvrb} \usepackage[T1]{fontenc} \graphicspath{{Figures/}}

\DefineVerbatimEnvironment{Code}{Verbatim}{} \DefineVerbatimEnvironment{CodeInput}{Verbatim}{fontshape=sl} \DefineVerbatimEnvironment{CodeOutput}{Verbatim}{} \newenvironment{CodeChunk}{}{}

\newcommand\latexcode[1]{#1}

\begin{document}
\begin{frontmatter}

\title{Supplementary material for the paper\\``Subpopulation treatment effect pattern plot (STEPP) methods with \textsf{R} and \textsf{Stata}''}
\runtitle{Supplementary material for STEPP methods with \textsf{R} and \textsf{Stata}}

\author[1]{
  \inits{S.}
  \fnms{Sergio}
  \snm{Venturini}  \thanksref{1}  \ead{sergio.venturini@unicatt.it}}
\author[2,3]{
  \inits{M.}
  \fnms{Marco}
  \snm{Bonetti}}
\author[4,5]{
  \inits{A. A.}
  \fnms{Ann A.}
  \snm{Lazar}}
\author[6]{
  \inits{B. F.}
  \fnms{Bernard F.}
  \snm{Cole}}
\author[7,8]{
  \inits{X. V.}
  \fnms{Xin Victoria}
  \snm{Wang}}
\author[7,8]{
  \inits{R. D.}
  \fnms{Richard D.}
  \snm{Gelber}}
\author[9]{
  \inits{W.-K.}
  \fnms{Wai-Ki}
  \snm{Yip}}

\thankstext[type=corresp,id=1]{Corresponding author}
\address[1]{Department of Economic and Social Sciences, 
  \institution{Universit\latexcode{\`a} Cattolica del Sacro Cuore, Via Bissolati 74, 26100 Cremona}, \cny{Italy}}
\address[2]{Carlo F. Dondena Research Centre, 
  \institution{Universit\latexcode{\`a} Commerciale L. Bocconi, Via R\latexcode{\"{o}}ntgen 1, 20136 Milano}, \cny{Italy}}
\address[3]{Bocconi Institute for Data Science and Analytics, 
  \institution{Universit\latexcode{\`a} Commerciale L. Bocconi, Via R\latexcode{\"{o}}ntgen 1, 20136 Milano}, \cny{Italy}}
\address[4]{Division of Oral Epidemiology, Department of Preventive and Restorative Dental Sciences, 
  \institution{University of California, San Francisco, 3333 California Street, San Francisco, CA 94118}, \cny{USA}}
\address[5]{Division of Biostatistics, Department of Epidemiology and Biostatistics, 
  \institution{University of California, San Francisco, 3333 California Street, San Francisco, CA 94118}, \cny{USA}}
\address[6]{Department of Mathematics and Statistics, 
  \institution{University of Vermont, 33 Colchester Avenue, Burlington, VT 05405}, \cny{USA}}
\address[7]{Department of Data Science, 
  \institution{Dana-Farber Cancer Institute, 450 Brookline Avenue, Mailstop CLS 11007, Boston, MA 02215}, \cny{USA}}
\address[8]{Department of Biostatistics, 
  \institution{Harvard T.H. Chan School of Public Health, 677 Huntington Avenue, Boston, MA 02215}, \cny{USA}}
\address[9]{
  \institution{Agenus, Inc., 3 Forbes Road, Lexington, MA 02421}, \cny{USA}}

\end{frontmatter}

\section*{Efficacy of aspirin in preventing colorectal adenomas} \label{sec:application_aspirin}

Here, we present a further STEPP analysis using the data originated from the Aspirin/Folate Polyp Prevention Study, a randomized, double-blind, placebo-controlled trial of the efficacy of oral aspirin, folic acid, or both as a chemoprevention agent against colorectal adenomas \citep{Baronetal2003}. Here, we limit the analysis to the aspirin component of the study. As usual, the aim of the analysis is the investigation of potential treatment-covariate interaction. More specifically, in this example the outcome corresponds to the occurrence of any pathologically confirmed colorectal adenomas and we are interested in assessing the interaction between the treatment effect and patients' age. A total of 1121 participants were randomized to two aspirin groups, that is 81 mg/day and 325 mg/day, or to the placebo arm. For brevity, we consider only the 81 mg/day arm \citep[a full analysis is available in][]{Yipetal2016}. Participants were then followed for 3 years. Findings in the original study report concluded that low-dose aspirin had a moderate chemopreventive effect against colorectal adenomas.

%We first load the data set, which is available in the package as the \texttt{aspirin} object, we remove the missing values, and we create the outcome and treatment indicators:
After removing the missing values, we create the outcome and treatment indicators:

\begin{Shaded}
\begin{Highlighting}[]
\FunctionTok{data}\NormalTok{(}\StringTok{"aspirin"}\NormalTok{, }\AttributeTok{package =} \StringTok{"stepp"}\NormalTok{)}
\NormalTok{aspirin\_c }\OtherTok{\textless{}{-}}\NormalTok{ aspirin[}\FunctionTok{complete.cases}\NormalTok{(aspirin), ]}
\NormalTok{aspirin\_sub }\OtherTok{\textless{}{-}} \FunctionTok{subset}\NormalTok{(aspirin\_c, DOSE }\SpecialCharTok{!=} \DecValTok{325}\NormalTok{)}
\NormalTok{aspirin\_sub}\SpecialCharTok{$}\NormalTok{Y }\OtherTok{\textless{}{-}} \FunctionTok{as.numeric}\NormalTok{(aspirin\_sub}\SpecialCharTok{$}\NormalTok{AD }\SpecialCharTok{==} \DecValTok{1} \SpecialCharTok{|}\NormalTok{ aspirin\_sub}\SpecialCharTok{$}\NormalTok{AL }\SpecialCharTok{==} \DecValTok{1}\NormalTok{)}
\NormalTok{aspirin\_sub}\SpecialCharTok{$}\NormalTok{trt }\OtherTok{\textless{}{-}} \FunctionTok{ifelse}\NormalTok{(aspirin\_sub}\SpecialCharTok{$}\NormalTok{DOSE }\SpecialCharTok{==} \DecValTok{0}\NormalTok{, }\DecValTok{0}\NormalTok{, }\DecValTok{1}\NormalTok{)}
\end{Highlighting}
\end{Shaded}

Then, we generate the subpopulations using a unit-based sliding window approach with \(r_1 = 30\) and \(r_2 = 100\), which produce 8 subpopulations:

\begin{Shaded}
\begin{Highlighting}[]
\NormalTok{swin }\OtherTok{\textless{}{-}} \FunctionTok{new}\NormalTok{(}\StringTok{"stwin"}\NormalTok{, }\AttributeTok{type =} \StringTok{"sliding"}\NormalTok{, }\AttributeTok{r1 =}\NormalTok{ 30, }\AttributeTok{r2 =}\NormalTok{ 100)}
\NormalTok{subp }\OtherTok{\textless{}{-}} \FunctionTok{new}\NormalTok{(}\StringTok{"stsubpop"}\NormalTok{)}
\NormalTok{subp }\OtherTok{\textless{}{-}} \FunctionTok{generate}\NormalTok{(subp, }\AttributeTok{win =}\NormalTok{ swin, }\AttributeTok{cov =}\NormalTok{ aspirin\_sub}\SpecialCharTok{$}\NormalTok{AGE)}
\FunctionTok{summary}\NormalTok{(subp)}
\end{Highlighting}
\end{Shaded}

\footnotesize

\begin{verbatim}
Window type: sliding
Number of patients per subpopulation (patspop r2): 100
Largest number of patients in common among consecutive subpopulations (minpatspop r1): 30
Number of subpopulations created: 8

Subpopulation summary information (including all treatments)
                                  Covariate Summary                 Sample
     Subpopulation        Median       Minimum       Maximum          size
           1               43.00       29.0000       47.0000           107
           2               50.00       46.0000       51.0000           128
           3               53.00       52.0000       55.0000           118
           4               57.00       55.0000       59.0000           127
           5               61.00       59.0000       62.0000           115
           6               64.00       62.0000       66.0000           103
           7               68.00       66.0000       71.0000           101
           8               73.00       70.0000       78.0000            89
\end{verbatim}

\normalsize

As usual, one may further inspect the impact of these choices through a sensitivity analysis that involves both \(r_1\) and \(r_2\).

Since the outcome in this application is binary, we run a STEPP analysis for the following \texttt{stmodelGLM} model with logit link,

\[
\text{logit}(p) = \beta_0 + \beta_1 \times \text{treatment},
\]
where \(p\) is the risk of developing a colorectal adenomas, and produce the corresponding plots (see Figure \ref{fig_aspirin_plot}):

\begin{Shaded}
\begin{Highlighting}[]
\NormalTok{res }\OtherTok{\textless{}{-}} \FunctionTok{new}\NormalTok{(}\StringTok{"steppes"}\NormalTok{)}
\NormalTok{modelGLM }\OtherTok{\textless{}{-}} \FunctionTok{new}\NormalTok{(}\StringTok{"stmodelGLM"}\NormalTok{, }\AttributeTok{coltrt =}\NormalTok{ aspirin\_sub}\SpecialCharTok{$}\NormalTok{trt,}
  \AttributeTok{colY =}\NormalTok{ aspirin\_sub}\SpecialCharTok{$}\NormalTok{Y, }\AttributeTok{glm =} \StringTok{"binomial"}\NormalTok{,}
  \AttributeTok{trts =} \FunctionTok{sort}\NormalTok{(}\FunctionTok{unique}\NormalTok{(aspirin\_sub}\SpecialCharTok{$}\NormalTok{trt)))}

\NormalTok{res }\OtherTok{\textless{}{-}} \FunctionTok{estimate}\NormalTok{(res, subp, modelGLM)}
\FunctionTok{set.seed}\NormalTok{(}\DecValTok{101}\NormalTok{)}
\NormalTok{nperm }\OtherTok{\textless{}{-}} \DecValTok{2500}
\NormalTok{res }\OtherTok{\textless{}{-}} \FunctionTok{test}\NormalTok{(res, nperm)}
\FunctionTok{print}\NormalTok{(res, }\AttributeTok{estimate =} \ConstantTok{TRUE}\NormalTok{, }\AttributeTok{cov =} \ConstantTok{FALSE}\NormalTok{, }\AttributeTok{test =} \ConstantTok{TRUE}\NormalTok{)}

\FunctionTok{plot}\NormalTok{(res, }\AttributeTok{ylabel =} \StringTok{"Risk of Colorectal Adenomas"}\NormalTok{,}
  \AttributeTok{xlabel =} \StringTok{"Median Age in Subpopulations"}\NormalTok{,}
  \AttributeTok{tlegend =} \FunctionTok{c}\NormalTok{(}\StringTok{"Placebo"}\NormalTok{, }\StringTok{"81 mg/day aspirin"}\NormalTok{), }\AttributeTok{legendy =} \FloatTok{0.5}\NormalTok{,}
  \AttributeTok{pointwise =} \ConstantTok{FALSE}\NormalTok{, }\AttributeTok{ylimit =} \FunctionTok{c}\NormalTok{(}\DecValTok{0}\NormalTok{, }\FloatTok{0.7}\NormalTok{, }\SpecialCharTok{{-}}\FloatTok{0.3}\NormalTok{, }\FloatTok{0.6}\NormalTok{, }\DecValTok{0}\NormalTok{, }\DecValTok{3}\NormalTok{),}
  \AttributeTok{lsty =} \FunctionTok{c}\NormalTok{(}\DecValTok{2}\NormalTok{, }\DecValTok{1}\NormalTok{), }\AttributeTok{marker =} \FunctionTok{c}\NormalTok{(}\DecValTok{15}\NormalTok{, }\DecValTok{17}\NormalTok{), }\AttributeTok{ncex =} \FloatTok{0.8}\NormalTok{, }\AttributeTok{at =} \DecValTok{8}\NormalTok{,}
  \AttributeTok{legend\_diff =} \FunctionTok{c}\NormalTok{(}\DecValTok{1}\NormalTok{, }\DecValTok{2}\NormalTok{))}
\end{Highlighting}
\end{Shaded}

\footnotesize

\begin{verbatim}
Sample size in treatment 0: 363
Sample size in treatment 1: 366
Total sample size (excluding missing data): 729

Risk estimates for treatment group 0
     Subpopulation         Risk          Std. Err.
           1              0.2979          0.0667
           2              0.3288          0.0550
           3              0.5517          0.0653
           4              0.6379          0.0631
           5              0.5161          0.0635
           6              0.4906          0.0687
           7              0.5102          0.0714
           8              0.5833          0.0712
        Overall           0.4711          0.0262

Risk estimates for treatment group 1
     Subpopulation         Risk          Std. Err.
           1              0.3833          0.0628
           2              0.3818          0.0655
           3              0.3333          0.0609
           4              0.2754          0.0538
           5              0.3585          0.0659
           6              0.4600          0.0705
           7              0.4423          0.0689
           8              0.5366          0.0779
        Overall           0.3825          0.0254

Effect differences and ratio estimates

trt 0 vs. trt 1

Risk differences
                           Risk
     Subpopulation      Difference       Std. Err.
           1             -0.0855          0.0916
           2             -0.0531          0.0855
           3              0.2184          0.0893
           4              0.3626          0.0829
           5              0.1576          0.0915
           6              0.0306          0.0984
           7              0.0679          0.0992
           8              0.0467          0.1055
        Overall           0.0886          0.0365

Odds ratios
                        log Odds
     Subpopulation        Ratio          Std. Err.          Odds Ratio
           1             -0.3820          0.4150              0.6825
           2             -0.2319          0.3730              0.7930
           3              0.9008          0.3804              2.4615
           4              1.5340          0.3838              4.6366
           5              0.6465          0.3829              1.9088
           6              0.1226          0.3950              1.1304
           7              0.2726          0.3995              1.3134
           8              0.1899          0.4287              1.2091
        Overall           0.3631          0.1504              1.4377

Supremum test results
trt 0 vs. trt 1
Interaction p-value based on effect estimate differences: 0.0068

Chi-square interaction p-value based on effect estimate differences: 0.0432
\end{verbatim}

\normalsize

\begin{figure}
\centering
\begin{subfigure}[t]{0.5\textwidth}
\centering
\includegraphics[width=1\linewidth]{./fig_aspirin_a-REV.pdf}
\caption{}
\label{fig_aspirin_plot_a}
\end{subfigure}%
\begin{subfigure}[t]{0.5\textwidth}
\centering
\includegraphics[width=1\linewidth]{./fig_aspirin_b-REV.pdf}
\caption{}
\label{fig_aspirin_plot_b}
\end{subfigure}
\begin{subfigure}[t]{0.5\textwidth}
\centering
\includegraphics[width=1\linewidth]{./fig_aspirin_c-REV.pdf}
\caption{}
\label{fig_aspirin_plot_c}
\end{subfigure}%
\caption{\texttt{aspirin} data. Plot of: (a) risk estimates of developing colorectal adenomas, (b) absolute treatment effect measured as the difference in the risk of developing colorectal adenomas estimates (aspirin minus placebo; a value below zero suggests that aspirin is better), (c) relative treatment effect measured as the odds ratio estimates (aspirin vs. placebo; a value less than one suggests that aspirin is better). Panels (b) and (c) also report the corresponding 95\% confidence regions.}
\label{fig_aspirin_plot}
\end{figure}

Both the output and the figures show that the risk for the placebo group is higher than the risk for the treatment group for all subpopulations apart from the first two. In particular, the risk for the placebo group rises quickly with age, while the risk for the treatment group first decreases but then starts increasing too, and the two converge at around age 60. In addition, the largest differences are observed in correspondence of the middle-aged subgroups. Similarly, the odds ratios are in favor of the treatment group in the same subpopulations. We also note that the p-value for the supremum test is very small signaling that the data provide evidence for heterogeneity in the treatment effects among the subpopulations. On the one hand, these results confirm the original study findings; that is, the 81 mg/day aspirin dose reduces the risk of adenomas compared with placebo. On the other hand, they also suggest that patients benefiting the most from the low-dose aspirin are those aged around 57 years.

\bibliography{steppmanuscript.bib}
\bibliographystyle{jds}


\end{document}
