## Preface

This page collects deviations from the [preregistration](	https://aspredicted.org/te3zw2.pdf):

### Preprocessing

- For preprocessing, only non-wear times that did not fall within a sleep window were set to `NA`
- For sleep-environment-related analyses, sleep windows were set based on `sleepprep`, i.e., the moment when participants were trying to sleep, instead of the actual sleep onset, which is `sleepprep` + `sleepdelay`, i.e., the added sleep delay. This mostly affects analyses that are connected to the Brown recommendation windows of healthy lighting (wake, pre-sleep, sleep)
- Metric change: geometric mean of melanopic EDI during 10 darkest hours of the day (lx) instead of 5 darkest hours were used. This is consistent with the midpoint of darkest 10 hours of the day and leads to a stable time frame.
- Metric change: the midpoint of longest period above 250 lx melanopic EDI is changed to mean timing above 250 lx melanopic EDI, because that does not reduce the day to a singular event.

### R1

- In H1, latitude had to be accounted for separately to site, as both in one model have the issue that each site has also an individual latitude means that the effect of latitude gets effectively removed. Instead, a model comparison via AIC was performed to check which model performed significantly better
- In H2, an `sz` basis was used to model the smooth of time by site, instead of a cyclic spline. While this has the downside that the ends of the spline (midnight to midnight) are not forced to the same estimate and derivative (i.e., a truly cyclic smooth), the `sz` basis is a new addition that solve identifiability issues with these models.
- In H2, a term for time was added, so that time by site only models differences to the overall term
- In H2, the average melanopic EDI per 30 minutes was used instead of the geometric average per hour. The reason is that the model itself modeled the average on a logarithmic scale much better from a model diagnostics standpoint compared to the geometric average. To offset the error of averaging, we moved to a 30 minute window instead of 1 hour.

### R2

- In H3 and H4, we have used a fixed effect of site instead of a random one, due to increased stability of model fits
- In H3 and H4, we have used a generalized linear mixed-effect model with an tweedie error distribution, due to better model performance.
- In H6, we have used the geometric average per hour instead of exposure metrics. The reasoning is the large amount of required metrics that would be hard to describe. The new hypothesis reads: **
- In H7 we have selected to only use parameter combinations that were significant in H2. Further, we chose not to use an interaction model, as the landscape of interaction between latitude and photoperiod is sparse. Only photoperiod was used and the hypothesis was adjusted to: *There is a ceiling effect of photoperiod with level, duration, and exposure-history-based metrics*