Patient involvement

Patient involvement has been important throughout the study, from inception to interpretation of the results. Co-author C.G. is a patient partner and co-applicant, while a patient and public involvement group of seven additional members has supported the study, meeting eight times in total. During the feasibility study,14 patients positively influenced the wording and display of questions within the app. C.G. and other members of the Patient and Public Involvement Group were involved in media broadcasts at study launch and subsequent public engagement activities, explaining why the research question was important to them and relevant to patients with long-term pain conditions.22 They have supported the interpretation of findings and the development of dissemination plans for the results, ensuring the results reach study participants, patient organizations and the general public.

Recruitment

We recruited participants through local and national media (television, radio, and press) and social media from 20 January 2016 to 20 January 2017. To participate in the study, participants needed to (i) be living with long-term (>3 months) pain conditions, (ii) be aged 17 years or older, (iii) be living in the United Kingdom, and (iv) own an Android or Apple iOS smartphone. Interested participants were directed to the study website (www.cloudywithachanceofpain.com) where they could check their eligibility, learn about the study, and download the uMotif app (Fig. 1). After downloading the study app, participants completed an electronic consent form and a baseline questionnaire including demographic information (sex, year of birth, first half of postcode), anatomical site(s) of pain, underlying pain condition(s), baseline medication use, and beliefs about the extent to which weather influenced their pain on a scale of 0–10, including which weather condition(s) were thought to be most associated with pain. Participants were then invited to collect daily symptoms for six months, or longer if willing. Each day, the app alerted participants to complete ten items at 6:24 p.m. (Fig. 1). The ten items were pain severity, fatigue, morning stiffness, impact of pain, sleep quality, time spent outside, waking up feeling tired, physical activity, mood, and well-being. Each data item had five possible labeled ordinal responses. For example, in response to the question “How severe was your pain today?”, possible responses were “no pain”, “mild pain”, “moderate pain”, “severe pain” or “very severe pain”. The data were analysed using a case-crossover design where, for each participant, exposure during days with a pain event (“hazard periods”) were compared to “control periods” without a pain event in the same month.23 Pain events were defined as a two-or-more category increase in pain from the preceding day, consistent with more stringent definitions of a clinically important difference24 (Fig. 3). Data collection ended on 20 April 2017.

Cohort selection

Participants were included in the final cohort for analysis if they fulfilled the following criteria: (1) downloaded the app; (2) provided consent; (3) completed the baseline questionnaire; and (4) contributed at least one pain event and matched control period in the same month (see below). During exploratory analysis, it was apparent that people reported higher pain levels in the first ten days following recruitment (perhaps due to calibration or regression to the mean). Therefore, the first ten days were excluded from the formal analysis. However, even if the first ten days were included, they had a negligible effect on the results (Supplementary Table 12).

The total person-days in study was calculated for each participant as the number of days between their first and last day of entering pain data. The number of person-days on which a pain score was entered was summed per participant, presented as a proportion of the total person-days in study, and averaged across the population. The geographical distribution of recruitment was described as the number of UK postcode areas represented (out of a maximum of 124).25 The movement of participants during the study was described as the median number of weather stations associated with each participant during their data-collection period.

Ethical approval

Ethical approval was obtained from the University of Manchester Research Ethics Committee (ref: ethics/15522) and from the NHS IRAS (ref: 23/NW/0716). Participants were required to provide electronic consent for study inclusion. Further details are available elsewhere.13,14

Weather data

Weather data were obtained by linking hourly smartphone GPS data to the nearest of 154 possible United Kingdom Met Office weather stations. Where GPS data were missing, we used significant location imputation. (For details, see supplement). Local hourly weather data were obtained from the Integrated Surface Database (ISD) of NOAA (http://www.ncdc.noaa.gov/isd), which includes hourly observations from UK Met Office weather stations.

Given the latitude–longitude coordinates of a participant location, the haversine distance to every Met Office weather station was calculated. The nearest station to the given location was selected, conditional on the distance being less than 100 km and the station having four weather variables (temperature, pressure, wind speed, and dewpoint temperature) available at that time. If all stations with the required weather data exceeded the maximum distance (100 km), the location was left unlinked and the observation was excluded from the analysis.

The significant location imputation approach for handling missing hourly GPS data had three stages.26 First, the participant’s observed location data were ordered by the frequency that the locations were visited. Second, the locations were spatially clustered using Hartigan’s Leader Algorithm27 with a threshold of 0.5 km. Third, missing locations during weekdays were replaced by the centroid of the participant’s most visited cluster for weekdays and missing locations during weekends were replaced by centroid of the participant’s most visited cluster for weekends.

Recruitment and retention

Recruitment and duration of follow-up were presented as a graph of cumulative recruitment and active participants, with participation ending at the last symptom entry. Retention in the study was also presented as a survival probability against time since recruitment, with participants censored when they were no longer eligible for follow-up. Eligible follow-up time ranged from 90 days (for those recruited on 20 January 2017) to 456 days (for those recruited on 20 January 2016). Engagement of participants was further described through clustering of engagement states, which has been described in detail elsewhere.13 Following recruitment, individuals were labeled as engaged if they reported any of the ten symptoms on a given day. A first-order hidden Markov model was used to estimate the levels of engagement of participants by assuming three latent engagement states: high, low, and disengaged. Clusters were defined according to different probabilities of transitioning between high engagement, low engagement and disengagement during the study. Retention of active participants was also presented stratified by engagement cluster, and in the subset of participants who contributed to the final analysis.

Analysis method

Days without pain events were only control periods if they were eligible to have a two-or-more category increase (i.e. the preceding day’s pain was lower than “severe”), thus fulfilling the exchangeability assumption for the case-crossover study design.28 With this design, participants serve as their own control, eliminating confounding by time-invariant factors. Each month per participant with at least one hazard and one control period formed a risk set. Conditional logistic regression was used to estimate the odds ratio (OR) for a pain event for four state weather variables (temperature, relative humidity, pressure, and wind speed). The condition logistic regression model was implemented with the assumption that the possible recurrent events (hazard periods) within a person are independent conditional on the subject-specific variables and other observed time-varying covariates. Further, we make sure that there is no overlap between case and control periods. Our assumption is reasonable given the time gap between subsequent events.

Each weather variable was included in univariable models and then all four were included in a multivariable analysis. Each weather variable was represented as a daily average per participant for the hazard or control period, with results presented as an OR for a pain event in response to a one-unit increase for temperature and wind speed (°C and meter per second, respectively) or a ten-unit increase for relative humidity and pressure (percentage points and millibar, respectively). Standardized odds ratios of each weather variable were also calculated. The relative importance of the four state weather variables was estimated by summing the Akaike weights.29 In all models, the preceding day’s pain score was included as it influenced the likelihood of a pain event the following day. The model was expanded to include mood and physical activity on the day of interest, included as binary variables. Time spent outside was considered as a possible effect modifier by including an interaction term with temperature, relative humidity, and wind speed. A directed acyclic graph is included in the supplementary material (Supplementary Fig. 5).

Sensitivity analyses were conducted to examine the effect of precipitation, day of the week, possible lag between weather and pain, change in weather from the day before the hazard or control day, disease type, sites of pain (single versus multiple sites) and prior beliefs in the weather–pain relationship. Respecting patients’ perspectives, we decided our primary analysis would focus on the whole chronic-pain population and our analyses of disease-specific associations would be secondary. We also re-ran the analysis including the first 10 days.

Daily pain-event estimates

Estimated odds ratio for a pain event per day compared to the average weather day were calculated using the following equation:

$${\mathrm{Odds}}\,{\mathrm{Ratio}} = {\mathrm{exp}},\begin{array}{*{20}{l}} {\left\{ {{\mathrm{\beta }}_{\mathrm{T}}\left( {{\mathrm{temperature}} - {\mathrm{\mu }}_{\mathrm{T}}} \right) + {\mathrm{\beta }}_{{\mathrm{RH}}}\left( {\frac{{{\mathrm{relative}}\,{\mathrm{humidity}} \, - \, {\mathrm{\mu }}_{{\mathrm{RH}}}}}{{10}}} \right)} \right.} \hfill \\ {\left. { \,+\, {\mathrm{\beta }}_{{\mathrm{wsp}}}\left( {{\mathrm{wind}}\,{\mathrm{speed}} - {\mathrm{\mu }}_{{\mathrm{wsp}}}} \right) + {\mathrm{\beta }}_{\mathrm{P}}\left( {\frac{{{\mathrm{pressure}} \, - \, {\mathrm{\mu }}_{\mathrm{p}}}}{{10}}} \right)} \right\}} \hfill \end{array}$$

where

β T = coefficient for temperature from final model,

β RH = coefficient for relative humidity,

β wsp = coefficient for wind speed,

β P = coefficient for pressure, and

μ T = mean temperature,

μ RH = mean relative humidity,

μ wsp = mean wind speed, and

μ p = mean pressure

of the daily UK means over the study period.

The predicted odds ratios of a pain event, relative to the average weather day, were plotted for all days within our study period for each of the four state weather variables.

Statistical analyses were performed using R 3.3.0.30

Reporting summary

Further information on research design is available in the Nature Research Reporting Summary linked to this article.