Statistical analysis
The statistical analysis plan was agreed by the investigators in advance. All analyses were carried out on an intention-to-treat basis. We included data from participants for whom at least 48 h of sensor glucose data were collected in at least one study period. Comparisons were made between values obtained during the 8-week randomized interventions. A two-sample A gatekeeping strategy was used, in which the primary endpoint was tested first and, if passing the significance testing, other key endpoints were tested in order. If a nonsignificant result was encountered, formal statistical hypothesis testing was terminated, and analysis of any key endpoints below the one in question (any that were lower in the hierarchy) was considered exploratory.A per-protocol analysis was carried out for the primary endpoint, restricted to randomized participants, with a minimum of 60% closed-loop use during the closed-loop therapy period and 60% sensor glucose availability during the control therapy period.Values are reported as mean ± s.d. for normally distributed values or median (IQR) for non-normally distributed values. Endpoints were calculated using GStat software v.2.3 (University of Cambridge, Cambridge, UK), and statistical analyses were performed using SPSS v.2 (IBM Software). All 