Here is the design of a clinical trial:

Official Title: A Theory-based Digital Intervention to Promote Weight Loss and Weight Loss Maintenance (Choosing Health): A Randomised Controlled Trial With Within Person Assessment

Included conditions:
- Overweight and Obesity

Study Armgroups:
- {'label': 'Intervention arm', 'type': 'EXPERIMENTAL', 'description': 'The intervention group participants will be assessed with EMA and they will provide daily data regarding their predictors of weight loss outcomes and their adherence to the personal weight loss plan (phase I, month 0-3). Then participants will receive tailored information regarding the most predictive factors relevant to their weight loss trajectories (phase II, month 3-6). The information will be tailored and delivered through emails and text messages.', 'interventionNames': ['Behavioral: Choosing Health Intervention']}
- {'label': 'Control arm', 'type': 'OTHER', 'description': 'Control group participants will receive basic educational weight loss information in a form of educational factual emails and text messages.', 'interventionNames': ['Behavioral: Choosing Health Control']}

Interventions:
- {'type': 'BEHAVIORAL', 'name': 'Choosing Health Intervention', 'description': 'The intervention consists of information materials provided at baseline in a form of eBook or a physical book depending on participants preferences. The book includes the rationale for the intervention, basic information on healthy eating and behaviour change and tables allowing self-monitoring of weight, physical activity and eating (i.e., brief food diary). The book is non-tailored and it has weekly tasks for the participants to complete during 26 weeks (initial 6 months) to support their weight loss. The intervention group will also receive a series of daily text messages and weekly email messages supporting their weight loss and promoting weight loss maintenance. In phase I (month 0-3), the messages and emails will be generic and factual; in the phase II of the intervention, participants will receive text messages and emails tailored to the strongest predictors of outcomes identified in phase I.', 'armGroupLabels': ['Intervention arm']}
- {'type': 'BEHAVIORAL', 'name': 'Choosing Health Control', 'description': 'The control consists of information materials provided at baseline in a form of eBook or a physical book depending on participants preferences. The book includes the rationale for the intervention and basic information on healthy eating and physical activity. The control group will also receive monthly email messages with generic and factual information.', 'armGroupLabels': ['Control arm']}

Primary Outcomes:
- {'measure': 'Weight', 'description': 'Mean difference in weight loss between groups at 6 months, in kilograms', 'timeFrame': 'Change from baseline to 6 months'}

Please estimate the sample size based on the assumption: 
80% power, alpha set at 0.05, 30% dropout rate, and scenarios with alpha at 0.1 for within participant components.
Sample size
        Projected sample size was calculated based on a statistical power analysis using the G*Power software. In order to detect a medium-to-large effect size for weight between the intervention and control groups (4 kg of weight loss difference with a SD of 10 kg at 6 months and a mean comparison condition body weight at 6 months follow-up of 85 kg), we estimate that a total of 100 participants per group would be required to achieve 80% power with alpha set at 0.05. Based on an estimated average drop out of 30% from online tailored interventions,40 a sample size of 285 participants is required to ensure 80% power.
        To estimate statistical power for the within participant components (ie, the required number of observations per participant), we conducted a simulation study (online supplemental material 2). As effect sizes and autocorrelation will likely differ between participants, as found in previous work,9 we describe the power for a range of parameters. We also consider a reduced type II error rate (false negative) with a corresponding increased type I error rate (false positive) preferable for the identification of potential predictors and so include power scenarios where alpha is set at 0.1. Results showed that 60 observations per participant in each study phase (phase I and phase II) would provide the following power for the two within participant study components: (1) for the identification of predictors of weight loss behaviour in phase I only, 60 observations will provide 80% power for an 0.5 effect size (d) with an autocorrelation of 0.5 and alpha at 0.10; alternatively, 50 observations would suffice to provide 80% power for an 0.5 effect size with an autocorrelation of 0.1 and alpha at 0.05; (2) for the interrupted time series component, 60 observations per phase would provide 77% power for an 0.8 effect size with an autocorrelation of 0.2 and alpha at 0.05.
        
          10.1136/bmjopen-2020-040183.supp2
          Supplementary data