  Technological advancements have made it possible to deliver mobile health
interventions to individuals. A novel framework that has emerged from such
advancements is the just-in-time adaptive intervention (JITAI), which aims to
suggest the right support to the individuals when their needs arise. The
micro-randomized trial (MRT) design has been proposed recently to test the
proximal effects of these JITAIs. However, the extant MRT framework only
considers components with a fixed number of categories added at the beginning
of the study. We propose a flexible MRT (FlexiMRT) design which allows addition
of more categories to the components during the study. The proposed design is
motivated by collaboration on the DIAMANTE study, which learns to deliver text
messages to encourage physical activity among the patients with diabetes and
depression. We developed a new test statistic and the corresponding sample size
calculator for the FlexiMRT using an approach similar to the generalized
estimating equation for longitudinal data. Simulation studies were conducted to
evaluate the sample size calculators and an R shiny application for the
calculators was developed.
