Title
Exploring the association between precipitation and hospital admission for mental disorders in Switzerland between 2009 and 2019 
Description
The present manuscript aims to advance knowledge on the impact of precipitation on mental health. In this research article, we assessed four definitions of precipitation events and found each definition had different patterns based on the season, sex, age, and sub-diagnosis groups. Additionally, we observed that the association between precipitation and hospital admissions for mental disorders seems to be heterogenous across cities. 

Data
The daily hospital admission data for mental disorders (F00-F98, ICD-10-GM) was collected between 2009 and 2019 in the eight major cities of Switzerland (Basel, Bern, Geneva, Lausanne, Lugano, Luzern, St. Gallen, and Zurich). This data was anonymized for patient residences by creating 706 geographical units called MedStat regions. The original analysis was based on datasets collected separately from eight major Swiss cities. For this study, the data were aggregated by sex, age group (0-64 years and ≥ 65 years), and specific sub-diagnosis. However, some MedStat regions were collected by only one hospital and cannot be made publicly available. Thus, the data used in this study is available upon request from the corresponding author.

Daily meteorological data (daily accumulated precipitation, daily mean temperature) for the whole of Switzerland from 1961 to 2019 was obtained. We derived daily city-level meteorological series by averaging the data from grid cells intersecting the selected MedStat regions in each of the eight main cities of Switzerland.

The materials
Datasets for each city used in the analysis are stored in CSV file, named data.csv.

Variables
	•	RhiresD: daily city-level accumulated precipitation data with 2 km x 2 km  resolutions
	•	TabsD: daily city-level mean temperature data with 1.6 km x 2.3 km resolutions
	•	Discharge.mean: daily river discharge data (Lugano was excluded due to the data availability)
	•	pp.2: the event when the daily precipitation was ≥ 1mm for 2 days (dummy variable)
	•	pp.3: the event when the daily precipitation was ≥ 1mm for 3 days (dummy variable)
	•	pp.4: the event when the daily precipitation was ≥ 1mm for 4 days (dummy variable)
	•	pep90.2: the event which exceeded the 90th percentile of the 30-year (1990 – 2019) baseline for 2 consecutive days (dummy variable)
	•	all: the total number of daily hospital admissions 
	•	a064y: the number of daily hospital admissions for patients aged  0 to 64 years
	•	a65plusy: the number of daily hospital admissions for patients aged 65 years and older
	•	sex1: the number of daily hospital admissions for male patients 
	•	sex2: the number of daily hospital admissions for female patients
	•	dF00F09: the number of daily hospital admissions for sub-diagnosis (F00 - F09)
	•	dF10F19: the number of daily hospital admissions for sub-diagnosis (F10 - F19)
	•	dF20F29: the number of daily hospital admissions for sub-diagnosis (F20 - F29)
	•	dF30F39: the number of daily hospital admissions for sub-diagnosis (F30 - F39)
	•	dF40F59: the number of daily hospital admissions for sub-diagnosis (F40 - F59)
	•	dF60F69: the number of daily hospital admissions for sub-diagnosis (F60 - F69)
	•	dF70F79: the number of daily hospital admissions for sub-diagnosis (F70 - F79)
	•	dF80F98: the number of daily hospital admissions for sub-diagnosis (F80 - F98)

R code
To reproduce the analysis, you can use the R code provided in the file Rcode.Rmd. The code is broken down into several scripts that should be executed in order. Some minor adjustments have been made to the code to accommodate the new data structure, but the changes are minimal. Additionally, the original code is available in the sub-folder origcode.Rmd, but it requires the original data to be used.