  Effect modification occurs when the impact of the treatment on an outcome
varies based on the levels of other covariates known as effect modifiers.
Modeling of these effect differences is important for etiological goals and for
purposes of optimizing treatment. Structural nested mean models (SNMMs) are
useful causal models for estimating the potentially heterogeneous effect of a
time-varying exposure on the mean of an outcome in the presence of time-varying
confounding. A data-driven approach for selecting the effect modifiers of an
exposure may be necessary if these effect modifiers are a priori unknown and
need to be identified. Although variable selection techniques are available in
the context of estimating conditional average treatment effects using marginal
structural models, or in the context of estimating optimal dynamic treatment
regimens, all of these methods consider an outcome measured at a single point
in time. In the context of an SNMM for repeated outcomes, we propose a doubly
robust penalized G-estimator for the causal effect of a time-varying exposure
with a simultaneous selection of effect modifiers and use this estimator to
analyze the effect modification in a study of hemodiafiltration. We prove the
oracle property of our estimator, and conduct a simulation study for evaluation
of its performance in finite samples and for verification of its
double-robustness property. Our work is motivated by and applied to the study
of hemodiafiltration for treating patients with end-stage renal disease at the
Centre Hospitalier de l'Universit\'e de Montr\'eal. We apply the proposed
method to investigate the effect heterogeneity of dialysis facility on the
repeated session-specific hemodiafiltration outcomes.
