Here is the design of a clinical trial:

Official Title: Melatonin for Prevention of Postoperative Delirium After Lower Limb Fracture Surgery in Elderly Patients: a Randomized Controlled Trial

Included conditions:
- Orthopedic Surgery

Study Armgroups:
- {'label': 'Experimental group', 'type': 'EXPERIMENTAL', 'description': 'melatonin 4mg per os every night, starting the evening before surgery (or 2 hours before emergency surgery) and until day 5 after surgery', 'interventionNames': ['Drug: Melatonin 4 mg']}
- {'label': 'Control group', 'type': 'PLACEBO_COMPARATOR', 'description': 'placebo of this drug with the same schedule, during the same period of time.', 'interventionNames': ['Drug: Placebo oral tablet']}

Interventions:
- {'type': 'DRUG', 'name': 'Melatonin 4 mg', 'description': 'melatonin 4mg per os every night, starting the evening before surgery (or 2 hours before emergency surgery) and until day 5 after surgery.', 'armGroupLabels': ['Experimental group']}
- {'type': 'DRUG', 'name': 'Placebo oral tablet', 'description': 'placebo of this drug with the same schedule, during the same period of time.', 'armGroupLabels': ['Control group']}

Primary Outcomes:
- {'measure': 'Postoperative delirium incidence', 'description': 'The Confusion Assessment Method (CAM) score, for patients hospitalized in surgery, or CAM-ICU score, for patients hospitalized in ICU will be applied daily during the first 10 days after surgery or end of hospital stay if shorter', 'timeFrame': '10 days after surgery'}

Please estimate the sample size based on the assumption: 
A bilateral type I error of 5%, a power of 90%, and a 10% dropout rate are assumed.
Sample size calculation
          In the literature, incidence rates of delirium in elderly populations in control groups in the first week after surgery or hospital admission range from 20.8% to 32.6%.19 20 29 We therefore expect a cumulative incidence of delirium of 25% at day 10 after surgery in the control group.
          Literature data are discordant on melatoninâs effect on the risk of delirium. In medical wards, meta-analyses11 30 found in elderly patients a decreased in the incidence of delirium between 60% and 75% with melatonin supplementation. In a postoperative setting the effect seems smaller but there are fewer studies, with discordant results, going from no effect to a 70% decrease of delirium incidence.19 20 29 We therefore expect a 40% risk reduction in the melatonin group with respect to placebo, which corresponds to a cumulative incidence of delirium of 15% at day 10 after surgery in the melatonin group. Adding to this assumption a bilateral type I error of 5% and a power 90%, we need to randomise 718 patients (359/group) in order to have 129 events and to detect a significant difference between arms (including 10% of patients that could not be evaluated). Sample size was computed with a Fine and Gray methods using R package cmprsk.31 We expect that 10% of included subjects will be secondarily excluded (not randomised) due to presence of delirium at inclusion. Therefore, we need to include 790 patients in order to randomise 718 subjects. Inclusions will continue until 718 patients are randomised.