Background

All European countries and many in the world have mental health laws that allow involuntary admission to psychiatric hospitals in cases of an acute illness bearing considerable risk of self-harm or harm to others [1,2,3]. Cases of admission under state mental health laws are rising during the last years, and therefore it is particularly important to understand the reasons for these developments in order to plan targeted preventive measures [4]. A recent meta-analysis by Walker et al. [5] determined patient-related, systemic and environment-related risk factors for involuntary hospitalisation. Patients were more likely to be detained when being unemployed, male, single or previously married, when being diagnosed with psychotic or bipolar affective disorders and when having had a history of previous involuntary admissions. On a systemic level, previous contact to a general practitioner, social support and availability of home visits were identified as protective factors, whereas the involvement of police and a high level of area deprivation such as higher rates of unemployment, increased population density and less homogeneity of incomes in the living area of the patient qualified as risk factors [5].

In the literature on determinants and risk factors for involuntary psychiatric inpatient treatment the term involuntary admission is used in multiple different ways. When inspecting the more recent studies included in the meta-analysis by Walker et al. [5], in most studies it is not indicated whether or not involuntary admissions also include cases that switched from voluntary to involuntary legal status in the course of treatment [6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32]. It remains unclear whether in these cases later involuntary hospitalisation was treated as voluntary or as involuntary, or whether these cases were excluded from analysis. In some studies with a longer time of observation, the status of voluntary or involuntary was defined by one among several admissions [34,35,36,37]. Some studies defined the admission status as involuntary if there had been at least one involuntary admission of the respective patient in the entire time of observation [33,34,35]. Another study defined the legal status based on the first time the respective patient had been hospitalised during the observation period irrespective of the legal status of subsequent hospital stays [36]. Only few studies specified explicitly whether or not cases with switched from voluntary to involuntary legal status were included [37, 38] or excluded from the analysis [39].

It is unclear, whether it is helpful or necessary to differentiate between the two subgroups and study them separately. Differences between the two subgroups might be potentially relevant when planning targeted preventive measures. Hence, if the two subgroups were different in respect to risk factors, it might be possible to plan different tailored interventions against coercion. To our knowledge, the potential differences of these two subgroups have never been investigated. This was the goal of this study in which we conducted a secondary analysis of data from a previous publication [38].

Methods

Setting

With its about one million inhabitants, Cologne is Germany’s fourth largest city. At the time of the present study inpatient psychiatric care in Cologne was provided by four hospitals. Each of them provided care to the population of a certain geographical sector of the city ranging from approximately 100,000 to 500,000 inhabitants. The Mental Health Act of the federal state of North Rhine Westphalia (PsychKG NRW) allows involuntary hospitalisation for individuals who are mentally ill if they present an immediate, severe threat to themselves or others and will not agree to be hospitalised. The PsychKG requires “a physician with experience in the field of psychiatry” to activate the relevant sections of the Mental Health Act with a report to the responsible municipal authority explaining the need for immediate confinement. On the same day or latest the day after admission, a court hearing must be held which decides about detention. One single Municipal court is responsible for all involuntary hospitalisations in Cologne.

Data sources and study design

In this secondary analysis we used the data of a previous retrospective study which analysed the health records of 5,764 inpatient cases of the four psychiatric hospitals in Cologne in the year 2011 [38]. The study included data of all 1,773 cases who were treated under the PsychKG NRW (Mental Health Act) and 3,991 cases who were treated voluntarily in the same hospitals and the same period of time (random sample out of 8,398 voluntary cases). Administrative, clinical, sociodemographic and socioeconomic data were extracted from the health records of each individual case by five trained assistant physicians. Diagnoses according to WHO ICD-10 classification [40] included both the main and all secondary diagnoses. The individual datasets were enriched by environmental socioeconomic data (ESED) characterizing the living environment of each case. The ESED were obtained from RWI-GEO-GRID [41] and provided information on household structures, house types, employment and unemployment as well as purchasing power for 1 × 1 km small grid cells [42]. The ESED and individual case data were merged through the postal code of the patient’s home address. More background information and details on the collection of the dataset can be found in our previous publications [38, 43].

In the present analysis we divided the 1,773 cases who were treated under the PsychKG NRW into two groups: Cases who were admitted to a psychiatric hospital against their will (n = 1,367) and cases who were admitted initially on their own will and were confined according to the Mental Health Act at some later point during in-patient treatment (n = 352). n = 54 cases were detained under legal guardianship (Civil Law Code/ BGB § 1906) at admission, but they also had a PsychKG issued later during their treatment. These cases were excluded from further analysis. All cases were anonymised and therefore, one patient can be represented with more than one case if having been admitted multiple times in 2011. Subsequently, the term cases instead of patients is used in this study.

Statistical analysis

For categorical data such as diagnoses, most sociodemographic data and other clinical details, chi-square tests were used and Bonferroni-adjusted. Both the main and secondary diagnoses were analysed. Separately, the comorbidities addiction and psychosis (F1 and F2), as well as addiction and personality disorder (F1 and F6) were investigated, as they are known to correlate with higher rates of aggressive behaviour, violent crimes, impulsivity and self-harming behaviour [44,45,46,47]. Metric data such as age, length of inpatient stay and the environmental sociodemographic characteristics were analysed by means of Mann–Whitney-U-Tests. The level of significance was set at p ≤ 0.05. For significant differences, we used Cramér’s V and Cliff’s delta to estimate the effect sizes.

For a more meaningful identification of predictor variables for either involuntary hospitalisation at admission or in the course of inpatient treatment, the Chi-square Automatic Interaction Detector (CHAID) was used. CHAID is an algorithm that generates decision trees by performing multiple chi-square tests. It thereby analyses interactions between the different variables which may be continuous or categorical. CHAID can be beneficial due to its ability to visually present a hierarchy of prediction factors. It shows the most significant interactions of variables and thereby indicates the most relevant possible prevention potentials [48]. CHAID became a regularly used method for risk assessments in health research. For example, it was used to predict delirium among patients in medical wards [49], readmission to internal medicine hospital wards [50] and obesity among children [51]. It was also previously used in mental health research, e.g. to predict the success of methadone treatments [52], post-traumatic stress disorders (PTSD) among war veterans [53], and the outcome of vocational rehabilitation for patients with affective disorders [54].

Although CHAID is easy to interpret, its limitations lay in the lack of ensemble techniques like bagging and random split selection. Another limitation is the poor handling of missing data. In order to obtain more robust information, we validated the results using a Random Forest model. The Random Forest algorithm selects random subsets and random variables of the dataset to create multiple decision trees. It thereby avoids overfitting, a common problem with decision tree algorithms, and is relatively robust to outliers and noise [55]. Random Forest models have become increasingly popular lately and have been previously used to predict the suicide risk of medical students [56] and the interaction between cognitive impairment in patients with schizophrenia and psychological distress and the immune system [57].

For the CHAID and Random Forest models, we performed a complete case analysis (n = 547) by listwise deletion of all cases with at least one missing value, and, in addition, we analysed all cases (n = 1,719) after imputation of missing data based on the proximity data from the Random Forest. As an orienting sensitivity analysis, we compared the two CHAID models by means of AUC and the two Random Forest models by means of AUC and the out-of-bag error rate (OOB) to check for differences in the model performance.

An Exhaustive CHAID on the datasets with and without imputed data was performed, including all clinical, sociodemographic and environmental socioeconomic characteristics. Split-sample validation was used with a random training sample of 70% and a test sample of 30%. The significance level for node splits and combination of categories was set at p ≤ 0.05 adapted with the Bonferroni method. The minimum case number for parent nodes was defined as n = 50 for the dataset without imputed data and n = 100 for the dataset with imputed data. The minimum child node size was defined as n = 20 and n = 50 respectively. The maximum tree depth was set at 3 levels beneath the root node. To keep the tree diagram lucid, the number of intervals for metric variables was set at 3.

For the Random Forest analysis, we also performed a random 70% training and 30% testing split of both datasets and controlled for the equal distribution of the variables in the training and testing sample. Based on the out-of-bag error rate (OOB), we decided for a tuned Random Forest model with 3 variables randomly sampled as candidates at each split. A total of 500 decision trees were grown and included in the Random Forest model. We measured the relevance of the included variables by the mean decrease in accuracy and mean decrease in Gini, which is a measure of impurity of the nodes. The higher the decrease in Gini the more the variable contributes to high purity in the node splits. The descriptive analysis and the CHAID were carried out with IBM SPSS Statistics version 26 and 27. The Random Forest analysis was carried out with the randomForest package version 4.6–14 in R version 4.0.5.

Results

Sociodemographic characteristics

Findings are summarised in Table 1. No significant differences were found between the two groups in regard to gender, marital status, relationship status, living situation, school education, degree of employment, main source of income and existence of children. Significant group differences were found regarding age, migration background, professional education and state of employment, however effect sizes were low. Cases that were involuntarily hospitalised at admission were older both when divided into age groups and as metric variable. For details on the age distribution consider Fig. 1. Also, they were somewhat less likely to have a migration background compared to patients who were involuntarily hospitalised later during their inpatient treatment. Patients who began their inpatient treatment voluntarily but were treated under the Mental Health Act later on were more often unemployed and lacking professional education.

Table 1 Sociodemographic characteristics
Fig. 1
figure 1

Age distribution depending on legal status

Environmental socioeconomic characteristics

Findings are summarised in Table 2. There were no group differences in seven out of eight variables. Significant differences were found for the number of children per 100 inhabitants in the neighbourhood. Cases with PsychKG in the course of inpatient treatment came from areas with a denser children population. However, the effect size of this finding was small. 9.8% of the cases could not be linked with environmental sociodemographic characteristics, mostly because of patients without a permanent place of residence.

Table 2 Environmental socioeconomic characteristics

Clinical and systemic characteristics

All details are shown in Table 3. In terms of the main diagnosis, patients with an organic mental disorder (ICD-10: F0) were more often involuntarily hospitalised at admission. Also, cases with mental and behavioural disorders due to psychoactive substance use (ICD-10: F1) were overrepresented in that group. Patients with schizophrenia, schizotypal and delusional disorders (ICD-10: F2) on the other hand were overrepresented among the cases that were detained during the later course of inpatient treatment. The group difference was significant, but effect size was low. Group differences were also significant when including both the main and all secondary diagnoses in the analysis, but, again, effect sizes were very low. 21.7 vs. 14.2% of the cases were diagnosed with an organic mental disorder, 49.3 vs. 41.5% with a substance abuse disorder and 31.2% vs. 46.6% with a psychotic disorder. Behavioural and emotional disorders with onset usually occurring in childhood and adolescence (ICD-10: F9) were also overrepresented among patients treated under the Mental Health Act in the course of their hospitalisation, but only with n = 6 (0.4%) vs. n = 5 (1.7%) cases.

Table 3 Clinical and systemic characteristics

Cases with suicidal tendencies upon admission were rather immediately involuntarily hospitalised than later during their treatment. Furthermore, patients who received no outpatient treatment prior to their inpatient stay were more likely to be involuntarily hospitalised at admission. Patients on the other hand who received either outpatient treatment or treatment in a day-care hospital and cases who had a history of previous psychiatric inpatient treatment were more often detained later during their hospitalisation. Again, all effect sizes were small.

Interestingly, the allocation to the treating hospital made a significant difference, with hospital 2 having a higher proportion of detentions during the course of inpatient stay compared to hospitals 1, 3 and 4. Admission within or outside regular service hours made no difference. Cases that had been in touch with the municipal socio-psychiatric services prior to admission were more often confined at admission. Finally, patients who were detained during the course of inpatient treatment stayed significantly longer hospitalised than involuntarily admitted cases.

Chi-squared Automatic Interaction Detection (CHAID)

The Exhaustive CHAID analysis of the complete case dataset led to 4 included variables represented in 9 nodes (Fig. 2). 72.8% (95% CI = 66.1, 79.5) of the cases were correctly predicted in the test sample but in fact the model predicted 100% of the cases to be involuntary at admission. The area under the curve for the test sample was AUC = 0.703.

Fig. 2
figure 2

CHAID decision tree model on the cases without missing data (complete case analysis)

The CHAID analysis on the imputed dataset equally consisted of 4 included variables and 11 nodes (Fig. 3). 76.5% (95% CI = 72.8, 80.2) of the cases were correctly predicted. The model performed better in correctly predicting the cases with PsychKG at admission. For the outcome of involuntary hospitalisation later during treatment the sensitivity was 13.9% and the specificity 94.0% which equals to a balanced accuracy of 54.0%. The AUC was 0.693 indicating a similar model fit compared to the complete case analysis.

Fig. 3
figure 3

CHAID decision tree model on the imputed dataset

In the CHAID model based on the complete case dataset, the first split was based on the treating hospital. Cases that were treated in hospital 2 more often experienced a change of legal status. For the cases in hospital 1, 3 and 4, the second split of the model was based on the presence of a psychotic disorder. Cases without a psychotic disorder were detained more often directly at admission. The cases without a psychotic disorder (node 4) were further differentiated by the presence of an affective disorder. The cases with an affective disorder were less often detained at admission than those without. Among the cases with a psychotic disorder (node 3), cases up to the age of 37 were more often involuntarily hospitalised at admission.

In the CHAID model on the imputed dataset, the first split was also based on the treating hospital and the cases in hospital 1,3 and 4 were again split based on presence of a psychotic disorder (node 3 and 4). Cases with as well as without a psychotic disorder that previously received outpatient treatment were less likely to receive involuntary treatment since admission (node 7 vs 8 and node 9 vs 10). The cases in hospital 2 were further divided based on the purchasing power per 100 inhabitants. Cases from an area with lower purchasing power were more often detained at admission.

Random Forest

The Random Forest model based on the imputed dataset predicted 80.9% (95% CI = 77.2, 84.2) correctly when applied to the test sample. The sensitivity was 10.2% and specificity 97.6% which results in a balanced accuracy of 53.9%. The area under the curve of AUC = 0.712 was slightly higher than for the CHAID model. The out-of-bag error rate (OOB) was 20.8%. To ensure that variables with a high proportion of missing values did not distort the results of the model, we computed the Random Forest model again after exclusion of the variable school education, which had the highest proportion of missing values (41.5%). The model fit was very similar to the previous computation with an AUC of 0.710.

The complete case Random Forest model had an OOB of 28.8% and AUC = 0.756 which indicates no bigger signs of distortion in comparison to the imputed dataset model. The Random Forest model on the complete case dataset achieved an accuracy of 82.9% (95% CI = 76.1, 88.4). The sensitivity was 28.1% and the specificity 96.8% which equals a balanced accuracy of 62.4%. The variables that caused the highest decrease in Gini and accuracy both for the complete case and imputed dataset model are shown in Fig. 4.

Fig. 4
figure 4

Random Forest model – The ten highest mean decreases in accuracy and Gini (impurity of the splits)

The most important variables for the accuracy of the imputed dataset model were determined as the treating hospital, age, the main diagnosis, main source of income and previous inpatient treatment. Several ESED were identified as important variables for the accuracy of the model as well. Age and the main diagnosis were also identified to have an impact on the purity of the node splits (Gini). Again, the ESED played an important role. The complete case analysis yielded similar results with addictive and psychotic disorders playing a bigger role in the model.

Discussion

The present study included the data of the 1,773 cases who were treated under the PsychKG NRW (Mental Health Act). The majority of clinical, systemic, sociodemographic and environmental socioeconomic characteristics did not differ between those who were admitted against their will (n = 1,367) and those who were admitted initially on their own will and were confined according to the Mental Health Act at some later point during in-patient treatment (n = 352). Cases that were admitted against their will were on average about five years older, they had somehow less often a migration background, had a slightly better professional education and were less often unemployed compared to those who were admitted initially on their own will and were confined according to the Mental Health Act at some later point during in-patient treatment. They lived in areas with fewer children per 100 inhabitants. They were less often diagnosed with a psychotic disorder and more often with an organic mental disorder or a substance abuse disorder. Unsurprisingly, they also showed higher suicidal tendencies upon admission, and they received less often outpatient or day patient treatment prior to admission. Also, they had less often a history of psychiatric inpatient treatments in the past. Finally, the average length of inpatient treatment for these cases was shorter. This latter finding may be interpreted as an impact of an extended treatment duration in cases with switch from voluntary to involuntary status due to worsened symptoms in the course of treatment. However, all effect sizes were small and the machine learning algorithms did not yield a causally interpretable prediction model: Both the CHAID and Random Forest models achieved unsatisfying accuracy rates, especially in the correct prediction of cases with switch of legal status from voluntary to involuntary during the course of inpatient stay. Another indicator for the limited explanatory power of the analysed variables is the small differences in decrease of accuracy and Gini per variable in the Random Forest model. None of the observed group differences in the descriptive analyses played a sufficient role in the tree models to be identified as an important determinant with reasonable certainty.

In summary, although we included a large number of socioeconomic, demographic, clinical and systemic variables, the characteristics were not sufficient to draw a clear differentiation between the two groups. The small differences we found are not easy to interpret, but it appears that also local differences in the handling of patients at risk of self-harm or harm to others and/ or differences in the patient populations of the hospitals play a role, as the treating hospital was one of the predominant influencing factors in the CHAID analysis. In an explorative post-hoc analysis, we investigated possible differences between the cases from hospital 2 and the other hospitals. Cases in hospital 2 were significantly older and more often retired. The main diagnosis in hospital 2 was more often an organic mental disorder and the cases less often showed suicidal tendencies at admission. Furthermore, also the ESED differed significantly: We found a higher purchasing power and lower unemployment rate per 100 inhabitants in the living environment of cases from hospital 2. Nonetheless, the reasons for these differences are subject to speculation and cannot be dissolved based on the data presented.

In conclusion, our results imply that there are more similarities than differences between the two subgroups of patients. Hence, it seems justified to consider them as one group. This applies both to further research activities and to planning preventive measures against coercion.

Strengths and limitations

The present study is based on a detailed in-depth analysis of health records of a comparatively large sample as we were able to include all cases of inpatient treatment under the Mental Health Act of an entire year and all four psychiatric hospitals of the Metropolitan city of Cologne, Germany. The districts the psychiatric hospitals provide care for are different in terms of socioeconomic characteristics and the procedures of involuntary hospitalisation might differ from hospital to hospital; however, by investigating all cases, we minimised distortion. Also, we were able to minimise distortion due to other systemic factors, as a single municipal court decides on all involuntary hospitalisations in the city of Cologne. Furthermore, other communal support structures, such as the socio-psychiatric services and outpatient treatment facilities, are comparable throughout the different sectors of the city. Another strength of our study is the application of two machine learning algorithms, the exhaustive CHAID and Random Forest. CHAID can increase the lucidity of the results and help depicting interactions between variables [48]. The additional usage of the Random Forest algorithm promised a further improvement of the accuracy of the findings [55].

A limitation of the study is the high number of missing values for some variables such as school education, professional education, main source of income and previously attempted suicides. We addressed this issue by comparing complete case models with imputation-based models. The analysis of the model robustness indicated no stronger influence of missing data patterns. Furthermore, the clinical records analysed in this study lacked other potentially interesting information such as adherence to pharmacological treatment at admission, symptom severity and social functioning level based on assessments using standardised psychometric instruments, previous psychoeducation, level of insight, and perceived social and professional support. These limitations are pertinent to the retrospective nature of the analysis. A prospective study design would have the potential to ensure more reliable results on the factors with many missing items and could detect more determinants that play a role in the occurrence of involuntary hospitalisation in general and a switch of voluntariness status during treatment in particular.

Finally, it is not clear how far our findings can be generalized. The legal framework and the practical procedures on the application of Mental Health Act in general and the switch of legal status during inpatient treatment seem to differ grossly in an international perspective. While our results are probably comparable to the situation in other metropolitan regions of Germany, this aspect of involuntary hospitalisation might be less prevalent in other regions and countries. In our sample, cases with a change of voluntariness status accounted for about one fifth of all cases with detention under the Mental Health Act. In comparison, a study from Canada reported n = 676 of such cases compared to a total number of 250,773 observed cases before exclusion which makes up less than 1% of the entire sample [37]. Also, a study from Brazil mentions the possibility of a converted voluntariness status in the course of treatment in Brazil but refers to it as something that in practice “seldom occurs” [58]. They nonetheless did not clarify whether or not such cases were included.

We suggest that both differences in the legal frameworks of involuntary hospitalisation and in local working practices and procedures might account for the variabilities found. The latter is in line with our finding of differences in the proportion of Mental Health Act cases with a switch in legal status among the four hospitals included in our study.

Conclusions

Despite some group differences, we were not able to establish a reliable model on determinants of compulsory hospitalisation under the Mental Health Act right at admission vs. later on during the course of inpatient treatment. The two groups seem to be more alike than different. We therefore propose to include cases with a switch of legal status from voluntary to involuntary during inpatient treatment in further research in this field.