Data analysis and statistics
delirium, SE
Data for the sleep, activity, and non-parametric circadian rest-activity metrics were extracted for each patient as defined and described above. For all metrics except for IS, we first examined the main effects of both the drug and delirium state independently via linear mixed effects models accounting for the repeated measures among participants and estimated marginal means ± standard errors (SE) were reported. Next, to test for associations over time from extubation, we used linear mixed effects models including either drug or delirium state as well as time (based on post-extubation day) and the interaction of either drug or delirium state with time as fixed effects, and a random effect of subject to account for repeated measures. All mixed effects models were conducted using the lmerTest package