This dataset and the accompagnying codebook was created using R version 3.4.4 on an Rstudio Server.

General remarks

PsyCourse 3.1 contains data of 1223 clinical and 320 control participants. The variable “v1_stat” gives information whethere the respective individual is a clinical or a control participant. For a more in-depth description of the PsyCourse study, please refer to and cite this article.

Three very important points to consider:

  1. PsyCourse is purely observational, i.e. there is no intervention at baseline such as e.g. in clinical trials. More bluntly stated, there is nothing special happening at the first measurement point.

  2. PsyCourse is very heterogeneous in terms of participants. Approximately half of them were treated as in- or daypatient at baseline, and the participants are from different disease stages.

  3. Longitudinal measurements were approximately six months aparts, which is a rather short time, so most longitudinal measurements are highly correlated.

Interviews were conducted in German, using German translations of the tests and scales presented herein. Some scales were measured only cross-sectionally, others were measured longitudinally, some were only measured in clinical participants, others only in control participants (see below). Wherever possible, we alternately used parallel versions of tests assessed multiple times to avoid recall effects.

Importantly, the assessment period of many variables varies greatly, this should be taken into account when making inferences. For example, the SCID questions generally assess if a symptom has ever occurrred (lifetime assessment), whereas other rating scales use the past week, or shorter, as assessment period.

We created this dataset and the accompanying code bookfor three reasons:

  1. Some items (especially demographic information) in the original case-report form (CRF, “Phänotypisierungsinventar”) are rather complicated (e.g. items on the German educational system) and virtually every item needs explanation.

  2. Missing values in our phenotype database do not distinguish between structurally missing data (missing because not applicable, e.g. skipped because a screening question was answered negatively) and missing because the information was not collected (for whatever reason, e.g. drop-out of study participants). This is especially important for machine learning analyses. In this dataset, structurally missing data are coded as -999; this includes items that were not assessed in the clinical or control subsample. The remaining missing values are coded as NA.

  3. The original CRF is in German language, so it is of little use for English-speaking collaborators.

Apart from providing a reproducible codebook for the PsyCourse study, this file also contains some descriptive statistics (e.g. how many NAs, distribution of data).

For easy navigation, the table of contents contanins links to the respective sections of the document, also the overview of the measured variables contains some links.

Variable names

The names of variables in the wide dataset are contained in the heading describing each variable. For example, “Age at first interview (continuous [years], v1_age)”, means that age at first interview is measured on a continuous scale, unit years, and that it has the name “v1_age” in the dataset.

If you request data from us in the context of a proposal:

  • Please use the corresponding variable names, e.g. v1_age, and not some description of the variable (e.g. “Age of participant”)
  • Please indicate whether you would like the data in long or wide format. If you request data in long format, please use the long format variable names, if possible. See also below (“Format of dataset”).

Scale levels

Variables in this dataset have one of the following scale levels: continuous, ordinal, categorical, dichotomous, checkbox and character. For continuous variables, the units (e.g. cm) are usually given in square brackets following the variable description([]). Ordinal or categorical variables often have a list of their levels/categories in square brackets. Please note that for ordinal variables, -999, if applicable, constitutes a level itself and thus care should be taken not to analyze together with the other ordinal levels. Dichotomous variables are usually coded “Y” (yes) and “N” (no), if not mentioned otherwise. Checkboxes are either checked (coded “Y”) or -999.

Important: When analyzing GAF or other continuous or ordinal variables containing -999, please keep in mind that the -999 will falsify your analysis, if you do not recode it.

Format of dataset

We now provide the dataset both in wide format (one row corresponds to one individual), and in long format (in which each row represents a study visit of one individual).

The variable names given in this codebook refer to the variables in wide format dataset. These have a “vX_” prefix, where X indicates the particulat study visit. In long format, variables that were measured multiple times (e.g. PANSS) do not have this prefix in the variable names (but the prefix is still present in cross-sectionally measured variables).

The wide format dataset is contained in the file “191018_v3.1_psycourse_wd.RData”, the long format dataset is contained in the file “191018_v3.1_psycourse_ln.RData”.

Also, .csv files are provided (“191018_v3.1_psycourse_wd.csv” and “191018_v3.1_psycourse_ln.csv). The field separator used in the .csv files is tab. Please note that information of scale levels is lost when using the .csv files. We recommend to analyze these data with R, using an .RData file and .

Disclaimer

This dataset was created from exports of our phenotype database. As we are still completing follow-up visits, relases of the dataset will include more participants and the information already in the database is also continuously improved.

Please also note that the dataset may contain errors, even though we do our best to avoid these. The re-coding of many variables also introduces error. Therefore, we recommend to look at the data you are analyzing carefully, and to contact us if suspicion arises.

Some basic QC steps were implemented, but please be sure to inspect the data you are analyzing thorougly.

Longitudinally and cross-sectionally measured variables

In the following table, “cl” means a test was only measured in clinical participants, “cn” that a test was only measured in control participants, and “b” that it was measured in both clinical and control participants.

Control individuals were recruited at the centers LMU Munich and UMG Göttingen. Now, all psychiatric rating scales (PANSS, IDS-C30, YMRS, and GAF) are also assessed in control individuals. However, at the beginning of control recruitment, these rating scales were not included in the assessment protocol. Therefore these data are missing from a subset of control individuals, as is the CAPE-42 (also introduced later). These control participants were recruited in the center UMG Göttingen.

Section Instrument Visit 1 Visit 2 Visit 3 Visit 4
Demographic information b b b b
Psychiatric history cl
Medication b b b b
ALDA scale cl1
Family history of psychiat. ill. b
Physical measures and somatic ill. b2
Substance abuse b b b b
Event triggering first ill. ep. cl
Illness episodes between study visits cl cl cl
Life events precipitating ill. ep. cl cl cl
Psych. problems between study visits cn cn cn
Screening for psychiatric disorders MINI-DIPS cn3
DSM-IV Diagnosis SCID I Depression cl
SCID I Hypo-/Mania cl
SCID I Psychosis cl
SCID I Suicidality cl cl cl cl
Neuropsychology (cognitive tests) Trail-Making-Test b b b b
Verbal digit span b b b b
Digit-symbol-test b b b b
MWT-B b
VLMT b b b
Rating scales PANSS b b b b
IDS-C30 b b b b
YMRS b b b b
CGI cl cl cl cl
GAF b b b b
OPCRIT item 90 cl
Questionnaires SF-12 cn cn cn cn
CAPE-42 cn
Religious beliefs b b4
Med. adherence cl cl cl cl
CTS b
BDI-II b b b b
ASRM b b b b
MSS b b b b
LEQ b b b b
WHOQOL-BREF b b b b
Personality b

In- and exclusion criteria of the study

Briefly, adult (minimum age 18 years) control and clinical participants were recruited. Clinical participants with the following ICD-10 diagnoses were recruited: schizophrenia (F20.X), acute and transient psychotic disorder (F23.X), schizoaffective disorder (F25.X), bipolar disorder (F31.X), manic episode (F30.X) and recurrent depressive disorder (F33.X). After conducting the SCID Interview (part of the first study visit), we ascertained that participants met one of the following corresponding DSM-IV diagnoses: schizophrenia (295.1/.2/.3/.6/.9), schizophreniform disorder (295.4), brief psychotic disorder (298.8), schizoaffective disorder (295.7), bipolar disorder (296.X [bipolar disorders incl. manic episode]) or recurrent major depression (296.3). If the DSM-IV diagnosis ascertained through SCID interview differed from the aforementioned DSM-IV diagnostic categories, the participant was excluded. Control participants were excluded from the study if they had ever been treated as inpatient for one of the investigated ICD-10 diagnoses.

Functions that are needed to recode variables from the original dataset to the described variables are defined here. This section is not relevant for people that want only to analyze data.

Load libraries

library("sjmisc") #neccessary for row_sum function

Define functions for descriptive analyses

desc <- function(x) {
  noquote(cbind(c("No. cases", "Percent"),rbind(summary(x), 
  round(summary(x)/length(x)*100,1)),
  c(length(x),sum(summary(x)/length(x)*100))))
  }
descT <- function(x) {
  noquote(cbind(c("No. cases", "Percent"),rbind(table(x, useNA="ifany"),
  round(table(x,useNA="ifany")/length(x)*100,1)),
  c(length(x),sum(table(x, useNA="ifany")/length(x)*100))))
  }
as.numeric.factor <- function(x) {as.numeric(levels(x))[x]}

Define functions to autmatically recode items from specific tests

CAPE-42 A and B items

#First argument w/o quotes, second with quotes
v1_cape_recode <- function(cape_old_name,cape_new_name) {
    
    itm_cape<-ifelse((is.na(v1_con$v1_cape_cape_korrekt) | v1_con$v1_cape_cape_korrekt!=2),
                  cape_old_name,NA) 
    
    all_itm_cape<-c(rep(-999,dim(v1_clin)[1]),itm_cape) #add -999 for clinical subjects
    
    assign(cape_new_name,all_itm_cape,envir=.GlobalEnv)
    
    descT(all_itm_cape)}

SF-12 items, Visit 1

#First argument w/o quotes, second with quotes
v1_sf12_recode <- function(v1_sf12_old_name,v1_sf12_new_name) {
    
    itm_sf12<-ifelse((is.na(v1_con$v1_sf12_sf12_korrekt) | v1_con$v1_sf12_sf12_korrekt!=2),
                  v1_sf12_old_name,NA) 
    
    v1_all_itm_sf12<-c(rep(-999,dim(v1_clin)[1]),itm_sf12) #add -999 for clinical subjects
    
    assign(v1_sf12_new_name,v1_all_itm_sf12,envir=.GlobalEnv)
    
    descT(v1_all_itm_sf12)}

SF-12 items, Visit 2

#First argument w/o quotes, second with quotes
v2_sf12_recode <- function(v2_sf12_old_name,v2_sf12_new_name) {
    
    itm_sf12<-ifelse((is.na(v2_con$v2_sf12_sf12_korrekt) | v2_con$v2_sf12_sf12_korrekt!=2),
                  v2_sf12_old_name,NA) 
    
    v2_all_itm_sf12<-c(rep(-999,dim(v2_clin)[1]),itm_sf12) #add -999 for clinical subjects
    
    assign(v2_sf12_new_name,v2_all_itm_sf12,envir=.GlobalEnv)
    
    descT(v2_all_itm_sf12)}

SF-12 items, Visit 3

#First argument w/o quotes, second with quotes
v3_sf12_recode <- function(v3_sf12_old_name,v3_sf12_new_name) {
    
    itm_sf12<-ifelse((is.na(v3_con$v3_sf12_sf12_korrekt) | v3_con$v3_sf12_sf12_korrekt!=2),
                  v3_sf12_old_name,NA) 
    
    v3_all_itm_sf12<-c(rep(-999,dim(v3_clin)[1]),itm_sf12) #add -999 for clinical subjects
    
    assign(v3_sf12_new_name,v3_all_itm_sf12,envir=.GlobalEnv)
    
    descT(v3_all_itm_sf12)}

SF-12 items, Visit 4

#First argument w/o quotes, second with quotes
v4_sf12_recode <- function(v4_sf12_old_name,v4_sf12_new_name) {
   
    itm_sf12<-ifelse((is.na(v4_con$v4_sf12_sf12_korrekt) | v4_con$v4_sf12_sf12_korrekt!=2),
                  v4_sf12_old_name,NA) 
    
    v4_all_itm_sf12<-c(rep(-999,dim(v4_clin)[1]),itm_sf12) #add -999 for clinical subjects
    
    assign(v4_sf12_new_name,v4_all_itm_sf12,envir=.GlobalEnv)
    
    descT(v4_all_itm_sf12)}

BDI-2 items, Visit 1

#First and second arguments w/o quotes, third with quotes
v1_bdi2_recode <- function(bdi2_clin_old_name,bdi2_con_old_name,bdi2_new_name) {
    
    v1_itm_bdi2_chk_clin<-v1_clin$v1_bdi2_s1_verwer_fragebogen
    v1_itm_bdi2_chk_con<-v1_con$v1_bdi2_s1_bdi_korrekt
    
    v1_itm_bdi2_clin<-ifelse((is.na(v1_itm_bdi2_chk_clin) | v1_itm_bdi2_chk_clin!=2),
                  bdi2_clin_old_name,NA) 
    
    v1_itm_bdi2_con<-ifelse((is.na(v1_itm_bdi2_chk_con) | v1_itm_bdi2_chk_con!=2),
                  bdi2_con_old_name,NA)               
    
    v1_all_itm_bdi2<-factor(c(v1_itm_bdi2_clin,v1_itm_bdi2_con),ordered=T)
    
    assign(bdi2_new_name,v1_all_itm_bdi2,envir=.GlobalEnv)
    
    descT(v1_all_itm_bdi2)}

BDI-2 items, Visit 2

#First and second arguments w/o quotes, third with quotes
v2_bdi2_recode <- function(bdi2_clin_old_name,bdi2_con_old_name,bdi2_new_name) {
    
    v2_itm_bdi2_chk_clin<-v2_clin$v2_bdi2_s1_verwer_fragebogen
    v2_itm_bdi2_chk_con<-v2_con$v2_bdi2_s1_bdi_korrekt
    
    v2_itm_bdi2_clin<-ifelse((is.na(v2_itm_bdi2_chk_clin) | v2_itm_bdi2_chk_clin!=2),
                  bdi2_clin_old_name,NA) 
    
    v2_itm_bdi2_con<-ifelse((is.na(v2_itm_bdi2_chk_con) | v2_itm_bdi2_chk_con!=2),
                  bdi2_con_old_name,NA)               
    
    v2_all_itm_bdi2<-factor(c(v2_itm_bdi2_clin,v2_itm_bdi2_con),ordered=T) 
    
    assign(bdi2_new_name,v2_all_itm_bdi2,envir=.GlobalEnv)
    
    descT(v2_all_itm_bdi2)}

BDI-2 items, Visit 3

#First and second arguments w/o quotes, third with quotes
v3_bdi2_recode <- function(bdi2_clin_old_name,bdi2_con_old_name,bdi2_new_name) {
    
    v3_itm_bdi2_chk_clin<-v3_clin$v3_bdi2_s1_verwer_fragebogen
    v3_itm_bdi2_chk_con<-v3_con$v3_bdi2_s1_bdi_korrekt
    
    v3_itm_bdi2_clin<-ifelse((is.na(v3_itm_bdi2_chk_clin) | v3_itm_bdi2_chk_clin!=2),
                  bdi2_clin_old_name,NA) 
    
    v3_itm_bdi2_con<-ifelse((is.na(v3_itm_bdi2_chk_con) | v3_itm_bdi2_chk_con!=2),
                  bdi2_con_old_name,NA)               
    
    v3_all_itm_bdi2<-factor(c(v3_itm_bdi2_clin,v3_itm_bdi2_con),ordered=T) 
    
    assign(bdi2_new_name,v3_all_itm_bdi2,envir=.GlobalEnv)
    
    descT(v3_all_itm_bdi2)}

BDI-2 items, Visit 4

#First and second arguments w/o quotes, third with quotes
v4_bdi2_recode <- function(bdi2_clin_old_name,bdi2_con_old_name,bdi2_new_name) {
    
    v4_itm_bdi2_chk_clin<-v4_clin$v4_bdi2_s1_verwer_fragebogen
    v4_itm_bdi2_chk_con<-v4_con$v4_bdi2_s1_bdi_korrekt
    
    v4_itm_bdi2_clin<-ifelse((is.na(v4_itm_bdi2_chk_clin) | v4_itm_bdi2_chk_clin!=2),
                  bdi2_clin_old_name,NA) 
    
    v4_itm_bdi2_con<-ifelse((is.na(v4_itm_bdi2_chk_con) | v4_itm_bdi2_chk_con!=2),
                  bdi2_con_old_name,NA)               
    
    v4_all_itm_bdi2<-factor(c(v4_itm_bdi2_clin,v4_itm_bdi2_con),ordered=T) 
    
    assign(bdi2_new_name,v4_all_itm_bdi2,envir=.GlobalEnv)
    
    descT(v4_all_itm_bdi2)}

ASRM items, Visit 1

#First and second arguments w/o quotes, second with quotes
v1_asrm_recode <- function(asrm_clin_old_name,asrm_con_old_name,asrm_new_name) {
    
    v1_itm_asrm_chk_clin<-v1_clin$v1_asrm_verwer_fragebogen
    v1_itm_asrm_chk_con<-v1_con$v1_asrm_asrm_korrekt
    
    v1_itm_asrm_clin<-ifelse((is.na(v1_itm_asrm_chk_clin) | v1_itm_asrm_chk_clin!=2),
                  asrm_clin_old_name,NA) 
    
    v1_itm_asrm_con<-ifelse((is.na(v1_itm_asrm_chk_con) | v1_itm_asrm_chk_con!=2),
                  asrm_con_old_name,NA)               
    
    v1_all_itm_asrm<-factor(c(v1_itm_asrm_clin,v1_itm_asrm_con),ordered=T) 
    
    assign(asrm_new_name,v1_all_itm_asrm,envir=.GlobalEnv)
    
    descT(v1_all_itm_asrm)}

ASRM items, Visit 2

#First and second arguments w/o quotes, second with quotes
v2_asrm_recode <- function(asrm_clin_old_name,asrm_con_old_name,asrm_new_name) {
    
    v2_itm_asrm_chk_clin<-v2_clin$v2_asrm_verwer_fragebogen
    v2_itm_asrm_chk_con<-v2_con$v2_asrm_asrm_korrekt
    
    v2_itm_asrm_clin<-ifelse((is.na(v2_itm_asrm_chk_clin) | v2_itm_asrm_chk_clin!=2),
                  asrm_clin_old_name,NA) 
    
    v2_itm_asrm_con<-ifelse((is.na(v2_itm_asrm_chk_con) | v2_itm_asrm_chk_con!=2),
                  asrm_con_old_name,NA)               
    
    v2_all_itm_asrm<-factor(c(v2_itm_asrm_clin,v2_itm_asrm_con),ordered=T) 
    
    assign(asrm_new_name,v2_all_itm_asrm,envir=.GlobalEnv)
    
    descT(v2_all_itm_asrm)}

ASRM items, Visit 3

#First and second arguments w/o quotes, second with quotes
v3_asrm_recode <- function(asrm_clin_old_name,asrm_con_old_name,asrm_new_name) {
    
    v3_itm_asrm_chk_clin<-v3_clin$v3_asrm_verwer_fragebogen
    v3_itm_asrm_chk_con<-v3_con$v3_asrm_asrm_korrekt
    
    v3_itm_asrm_clin<-ifelse((is.na(v3_itm_asrm_chk_clin) | v3_itm_asrm_chk_clin!=2),
                  asrm_clin_old_name,NA) 
    
    v3_itm_asrm_con<-ifelse((is.na(v3_itm_asrm_chk_con) | v3_itm_asrm_chk_con!=2),
                  asrm_con_old_name,NA)               
    
    v3_all_itm_asrm<-factor(c(v3_itm_asrm_clin,v3_itm_asrm_con),ordered=T) 
    
    assign(asrm_new_name,v3_all_itm_asrm,envir=.GlobalEnv)
    
    descT(v3_all_itm_asrm)}

ASRM items, Visit 4

#First and second arguments w/o quotes, second with quotes
v4_asrm_recode <- function(asrm_clin_old_name,asrm_con_old_name,asrm_new_name) {
    
    v4_itm_asrm_chk_clin<-v4_clin$v4_asrm_verwer_fragebogen
    v4_itm_asrm_chk_con<-v4_con$v4_asrm_asrm_korrekt
    
    v4_itm_asrm_clin<-ifelse((is.na(v4_itm_asrm_chk_clin) | v4_itm_asrm_chk_clin!=2),
                  asrm_clin_old_name,NA) 
    
    v4_itm_asrm_con<-ifelse((is.na(v4_itm_asrm_chk_con) | v4_itm_asrm_chk_con!=2),
                  asrm_con_old_name,NA)               
    
    v4_all_itm_asrm<-factor(c(v4_itm_asrm_clin,v4_itm_asrm_con),ordered=T) 
    
    assign(asrm_new_name,v4_all_itm_asrm,envir=.GlobalEnv)
    
    descT(v4_all_itm_asrm)}

MSS items, Visit 1

#First and second arguments w/o quotes, third with quotes
v1_mss_recode <- function(mss_clin_old_name,mss_con_old_name,mss_new_name) {
    
    v1_itm_mss_chk_clin<-v1_clin$v1_mss_s1_verwer_fragebogen
    v1_itm_mss_chk_con<-v1_con$v1_mss_s1_mss_korrekt
    
    v1_itm_mss_clin<-ifelse((is.na(v1_itm_mss_chk_clin) | v1_itm_mss_chk_clin!=2),
                  mss_clin_old_name,NA) 
    
    v1_itm_mss_con<-ifelse((is.na(v1_itm_mss_chk_con) | v1_itm_mss_chk_con!=2),
                  mss_con_old_name,NA)               
    
    v1_all_itm_mss<-c(v1_itm_mss_clin,v1_itm_mss_con)
    v1_all_itm_mss<-factor(ifelse(v1_all_itm_mss==1,"Y","N"))
    
    assign(mss_new_name,v1_all_itm_mss,envir=.GlobalEnv)
    
    descT(v1_all_itm_mss)}

MSS items, Visit 2

#First and second arguments w/o quotes, third with quotes
v2_mss_recode <- function(mss_clin_old_name,mss_con_old_name,mss_new_name) {
    
    v2_itm_mss_chk_clin<-v2_clin$v2_mss_s1_verwer_fragebogen
    v2_itm_mss_chk_con<-v2_con$v2_mss_s1_mss_korrekt
    
    v2_itm_mss_clin<-ifelse((is.na(v2_itm_mss_chk_clin) | v2_itm_mss_chk_clin!=2),
                  mss_clin_old_name,NA) 
    
    v2_itm_mss_con<-ifelse((is.na(v2_itm_mss_chk_con) | v2_itm_mss_chk_con!=2),
                  mss_con_old_name,NA)               
    
    v2_all_itm_mss<-c(v2_itm_mss_clin,v2_itm_mss_con)
    v2_all_itm_mss<-factor(ifelse(v2_all_itm_mss==1,"Y","N"))
    
    assign(mss_new_name,v2_all_itm_mss,envir=.GlobalEnv)
    
    descT(v2_all_itm_mss)}

MSS items, Visit 3

#First and second arguments w/o quotes, third with quotes
v3_mss_recode <- function(mss_clin_old_name,mss_con_old_name,mss_new_name) {
    
    v3_itm_mss_chk_clin<-v3_clin$v3_mss_s1_verwer_fragebogen
    v3_itm_mss_chk_con<-v3_con$v3_mss_s1_mss_korrekt
    
    v3_itm_mss_clin<-ifelse((is.na(v3_itm_mss_chk_clin) | v3_itm_mss_chk_clin!=2),
                  mss_clin_old_name,NA) 
    
    v3_itm_mss_con<-ifelse((is.na(v3_itm_mss_chk_con) | v3_itm_mss_chk_con!=2),
                  mss_con_old_name,NA)               
    
    v3_all_itm_mss<-c(v3_itm_mss_clin,v3_itm_mss_con)
    v3_all_itm_mss<-factor(ifelse(v3_all_itm_mss==1,"Y","N"))
    
    assign(mss_new_name,v3_all_itm_mss,envir=.GlobalEnv)
    
    descT(v3_all_itm_mss)}

MSS items, Visit 4

#First and second arguments w/o quotes, third with quotes
v4_mss_recode <- function(mss_clin_old_name,mss_con_old_name,mss_new_name) {
    
    v4_itm_mss_chk_clin<-v4_clin$v4_mss_s1_verwer_fragebogen
    v4_itm_mss_chk_con<-v4_con$v4_mss_s1_mss_korrekt
    
    v4_itm_mss_clin<-ifelse((is.na(v4_itm_mss_chk_clin) | v4_itm_mss_chk_clin!=2),
                  mss_clin_old_name,NA) 
    
    v4_itm_mss_con<-ifelse((is.na(v4_itm_mss_chk_con) | v4_itm_mss_chk_con!=2),
                  mss_con_old_name,NA)               
    
    v4_all_itm_mss<-c(v4_itm_mss_clin,v4_itm_mss_con)
    v4_all_itm_mss<-factor(ifelse(v4_all_itm_mss==1,"Y","N"))
    
    assign(mss_new_name,v4_all_itm_mss,envir=.GlobalEnv)
    
    descT(v4_all_itm_mss)}

LEQ A Items, Visit 1

#First and second arguments w/o quotes, third with quotes
v1_leq_a_recode <- function(leq_clin_old_name,leq_con_old_name,leq_new_name) {
  
    v1_itm_leq_chk_clin<-v1_clin$v1_leq_a_verwer_fragebogen
    v1_itm_leq_chk_con<-v1_con$v1_leq_a_leq_korrekt
    
    v1_itm_leq_clin<-rep(NA,dim(v1_clin)[1])
    v1_itm_leq_con<-rep(NA,dim(v1_con)[1])
    
    v1_itm_leq_clin<-ifelse(((is.na(v1_itm_leq_chk_clin) | v1_itm_leq_chk_clin!=2) & is.na(leq_clin_old_name)==F),
                  leq_clin_old_name, 
                      ifelse(((is.na(v1_itm_leq_chk_clin) | v1_itm_leq_chk_clin!=2) & is.na(leq_clin_old_name)), -999, v1_itm_leq_clin))
    
    v1_itm_leq_con<-ifelse(((is.na(v1_itm_leq_chk_con) | v1_itm_leq_chk_con!=2) & is.na(leq_con_old_name)==F),
                  leq_con_old_name,
                      ifelse(((is.na(v1_itm_leq_chk_con) | v1_itm_leq_chk_con!=2) & is.na(leq_con_old_name)), -999, v1_itm_leq_con))    
    
    v1_all_itm_leq<-c(v1_itm_leq_clin,v1_itm_leq_con)
    
    v1_all_itm_leq[v1_all_itm_leq==1]<-"good"
    v1_all_itm_leq[v1_all_itm_leq==0]<-"bad"
    v1_all_itm_leq<-factor(v1_all_itm_leq)
    
    assign(leq_new_name,v1_all_itm_leq,envir=.GlobalEnv)
    
    descT(v1_all_itm_leq)}

LEQ A Items, Visit 2

#First and second arguments w/o quotes, third with quotes
v2_leq_a_recode <- function(leq_clin_old_name,leq_con_old_name,leq_new_name) {
    
    v2_itm_leq_chk_clin<-v2_clin$v2_leq_a_verwer_fragebogen
    v2_itm_leq_chk_con<-v2_con$v2_leq_a_leq_korrekt
    
    v2_itm_leq_clin<-rep(NA,dim(v2_clin)[1])
    v2_itm_leq_con<-rep(NA,dim(v2_con)[1])
    
    v2_itm_leq_clin<-ifelse(is.na(v2_clin$v2_ausschluss1_rekr_datum), NA,
                      ifelse(((is.na(v2_itm_leq_chk_clin) | v2_itm_leq_chk_clin!=2) & is.na(leq_clin_old_name)==F),leq_clin_old_name,
                       ifelse(((is.na(v2_itm_leq_chk_clin) | v2_itm_leq_chk_clin!=2) & is.na(leq_clin_old_name)), -999, v2_itm_leq_clin)))
    
    v2_itm_leq_con<-ifelse(is.na(v2_con$v2_rekru_visit_rekr_datum), NA,
                     ifelse(((is.na(v2_itm_leq_chk_con) | v2_itm_leq_chk_con!=2) & is.na(leq_con_old_name)==F),leq_con_old_name,
                      ifelse(((is.na(v2_itm_leq_chk_con) | v2_itm_leq_chk_con!=2) & is.na(leq_con_old_name)), -999, v2_itm_leq_con)))
    
    v2_all_itm_leq<-c(v2_itm_leq_clin,v2_itm_leq_con)
    
    v2_all_itm_leq[v2_all_itm_leq==1]<-"good"
    v2_all_itm_leq[v2_all_itm_leq==0]<-"bad"
    v2_all_itm_leq<-factor(v2_all_itm_leq)
    
    assign(leq_new_name,v2_all_itm_leq,envir=.GlobalEnv)
    
    descT(v2_all_itm_leq)}

LEQ A Items, Visit 3

#First and second arguments w/o quotes, third with quotes
v3_leq_a_recode <- function(leq_clin_old_name,leq_con_old_name,leq_new_name) {
    
    v3_itm_leq_chk_clin<-v3_clin$v3_leq_a_verwer_fragebogen
    v3_itm_leq_chk_con<-v3_con$v3_leq_a_leq_korrekt
    
    v3_itm_leq_clin<-rep(NA,dim(v3_clin)[1])
    v3_itm_leq_con<-rep(NA,dim(v3_con)[1])
    
    v3_itm_leq_clin<-ifelse(is.na(v3_clin$v3_ausschluss1_rekr_datum), NA,
                      ifelse(((is.na(v3_itm_leq_chk_clin) | v3_itm_leq_chk_clin!=2) & is.na(leq_clin_old_name)==F),leq_clin_old_name,
                       ifelse(((is.na(v3_itm_leq_chk_clin) | v3_itm_leq_chk_clin!=2) & is.na(leq_clin_old_name)), -999, v3_itm_leq_clin)))
    
    v3_itm_leq_con<-ifelse(is.na(v3_con$v3_rekru_visit_rekr_datum), NA,
                     ifelse(((is.na(v3_itm_leq_chk_con) | v3_itm_leq_chk_con!=2) & is.na(leq_con_old_name)==F),leq_con_old_name,
                      ifelse(((is.na(v3_itm_leq_chk_con) | v3_itm_leq_chk_con!=2) & is.na(leq_con_old_name)), -999, v3_itm_leq_con)))
    
    v3_all_itm_leq<-c(v3_itm_leq_clin,v3_itm_leq_con)
    
    v3_all_itm_leq[v3_all_itm_leq==1]<-"good"
    v3_all_itm_leq[v3_all_itm_leq==0]<-"bad"
    v3_all_itm_leq<-factor(v3_all_itm_leq)
    
    assign(leq_new_name,v3_all_itm_leq,envir=.GlobalEnv)
    
    descT(v3_all_itm_leq)}

LEQ A Items, Visit 4

#First and second arguments w/o quotes, third with quotes
v4_leq_a_recode <- function(leq_clin_old_name,leq_con_old_name,leq_new_name) {
    
    v4_itm_leq_chk_clin<-v4_clin$v4_leq_a_verwer_fragebogen
    v4_itm_leq_chk_con<-v4_con$v4_leq_a_leq_korrekt
    
    v4_itm_leq_clin<-rep(NA,dim(v4_clin)[1])
    v4_itm_leq_con<-rep(NA,dim(v4_con)[1])
    
    v4_itm_leq_clin<-ifelse(is.na(v4_clin$v4_ausschluss1_rekr_datum), NA,
                      ifelse(((is.na(v4_itm_leq_chk_clin) | v4_itm_leq_chk_clin!=2) & is.na(leq_clin_old_name)==F),leq_clin_old_name,
                       ifelse(((is.na(v4_itm_leq_chk_clin) | v4_itm_leq_chk_clin!=2) & is.na(leq_clin_old_name)), -999, v4_itm_leq_clin)))
    
    v4_itm_leq_con<-ifelse(is.na(v4_con$v4_rekru_visit_rekr_datum), NA,
                     ifelse(((is.na(v4_itm_leq_chk_con) | v4_itm_leq_chk_con!=2) & is.na(leq_con_old_name)==F),leq_con_old_name,
                      ifelse(((is.na(v4_itm_leq_chk_con) | v4_itm_leq_chk_con!=2) & is.na(leq_con_old_name)), -999, v4_itm_leq_con)))
    
    v4_all_itm_leq<-c(v4_itm_leq_clin,v4_itm_leq_con)
    
    v4_all_itm_leq[v4_all_itm_leq==1]<-"good"
    v4_all_itm_leq[v4_all_itm_leq==0]<-"bad"
    v4_all_itm_leq<-factor(v4_all_itm_leq)
    
    assign(leq_new_name,v4_all_itm_leq,envir=.GlobalEnv)
    
    descT(v4_all_itm_leq)}

LEQ B Items, Visit 1

#First and second arguments w/o quotes, third with quotes
v1_leq_b_recode <- function(leq_clin_old_name,leq_con_old_name,leq_new_name) {
    
    v1_itm_leq_chk_clin<-v1_clin$v1_leq_a_verwer_fragebogen
    v1_itm_leq_chk_con<-v1_con$v1_leq_a_leq_korrekt
    
    v1_itm_leq_b_clin<-rep(NA,dim(v1_clin)[1])
    v1_itm_leq_b_con<-rep(NA,dim(v1_con)[1])
    
    v1_itm_leq_b_clin<-ifelse((is.na(v1_itm_leq_chk_clin) | v1_itm_leq_chk_clin!=2) & 
                 is.na(leq_clin_old_name), -999,   
                #data present but this LEQ item empty -> -999
                ifelse((is.na(v1_itm_leq_chk_clin) | v1_itm_leq_chk_clin!=2) &
                        !is.na(leq_clin_old_name),leq_clin_old_name,NA))
    
    v1_itm_leq_b_con<-ifelse((is.na(v1_itm_leq_chk_con) | v1_itm_leq_chk_con!=2) & 
                 is.na(leq_con_old_name), -999,   
                #data present but this LEQ item empty -> -999
                ifelse((is.na(v1_itm_leq_chk_con) | v1_itm_leq_chk_con!=2) &
                        !is.na(leq_con_old_name),leq_con_old_name,NA))
    
    v1_all_itm_leq_b<-factor(c(v1_itm_leq_b_clin,v1_itm_leq_b_con),ordered=T)

    assign(leq_new_name,v1_all_itm_leq_b,envir=.GlobalEnv)
    
    descT(v1_all_itm_leq_b)}

LEQ B Items, Visit 2

#First and second arguments w/o quotes, third with quotes
v2_leq_b_recode <- function(leq_clin_old_name,leq_con_old_name,leq_new_name) {
  
    v2_itm_leq_chk_clin<-v2_clin$v2_leq_a_verwer_fragebogen
    v2_itm_leq_chk_con<-v2_con$v2_leq_a_leq_korrekt
    
    v2_itm_leq_b_clin<-rep(NA,dim(v2_clin)[1])
    v2_itm_leq_b_con<-rep(NA,dim(v2_con)[1])
    
    v2_itm_leq_b_clin<-ifelse(is.na(v2_clin$v2_ausschluss1_rekr_datum), NA,
                        ifelse((is.na(v2_itm_leq_chk_clin) | v2_itm_leq_chk_clin!=2) & is.na(leq_clin_old_name), -999, #data but LEQ item empty -> -999
                          ifelse((is.na(v2_itm_leq_chk_clin) | v2_itm_leq_chk_clin!=2) & !is.na(leq_clin_old_name),leq_clin_old_name,NA)))
    
    v2_itm_leq_b_con<-ifelse(is.na(v2_con$v2_rekru_visit_rekr_datum), NA,
                       ifelse((is.na(v2_itm_leq_chk_con) | v2_itm_leq_chk_con!=2) & is.na(leq_con_old_name), -999, #data but LEQ item empty -> -999
                        ifelse((is.na(v2_itm_leq_chk_con) | v2_itm_leq_chk_con!=2) & !is.na(leq_con_old_name),leq_con_old_name,NA)))
    
    v2_all_itm_leq_b<-factor(c(v2_itm_leq_b_clin,v2_itm_leq_b_con),ordered=T)

    assign(leq_new_name,v2_all_itm_leq_b,envir=.GlobalEnv)
    
    descT(v2_all_itm_leq_b)}

LEQ B Items, Visit 3

#First and second arguments w/o quotes, third with quotes
v3_leq_b_recode <- function(leq_clin_old_name,leq_con_old_name,leq_new_name) {
    
    v3_itm_leq_chk_clin<-v3_clin$v3_leq_a_verwer_fragebogen
    v3_itm_leq_chk_con<-v3_con$v3_leq_a_leq_korrekt
    
    v3_itm_leq_b_clin<-rep(NA,dim(v3_clin)[1])
    v3_itm_leq_b_con<-rep(NA,dim(v3_con)[1])
    
    v3_itm_leq_b_clin<-ifelse(is.na(v3_clin$v3_ausschluss1_rekr_datum), NA,
                        ifelse((is.na(v3_itm_leq_chk_clin) | v3_itm_leq_chk_clin!=2) & is.na(leq_clin_old_name), -999, #data but LEQ item empty -> -999
                          ifelse((is.na(v3_itm_leq_chk_clin) | v3_itm_leq_chk_clin!=2) & !is.na(leq_clin_old_name),leq_clin_old_name,NA)))
    
    v3_itm_leq_b_con<-ifelse(is.na(v3_con$v3_rekru_visit_rekr_datum), NA,
                       ifelse((is.na(v3_itm_leq_chk_con) | v3_itm_leq_chk_con!=2) & is.na(leq_con_old_name), -999, #data but LEQ item empty -> -999
                        ifelse((is.na(v3_itm_leq_chk_con) | v3_itm_leq_chk_con!=2) & !is.na(leq_con_old_name),leq_con_old_name,NA)))
    
    v3_all_itm_leq_b<-factor(c(v3_itm_leq_b_clin,v3_itm_leq_b_con),ordered=T)

    assign(leq_new_name,v3_all_itm_leq_b,envir=.GlobalEnv)
    
    descT(v3_all_itm_leq_b)}

LEQ B Items, Visit 4

#First and second arguments w/o quotes, third with quotes
v4_leq_b_recode <- function(leq_clin_old_name,leq_con_old_name,leq_new_name) {
    
    v4_itm_leq_chk_clin<-v4_clin$v4_leq_a_verwer_fragebogen
    v4_itm_leq_chk_con<-v4_con$v4_leq_a_leq_korrekt
    
    v4_itm_leq_b_clin<-rep(NA,dim(v4_clin)[1])
    v4_itm_leq_b_con<-rep(NA,dim(v4_con)[1])
    
    v4_itm_leq_b_clin<-ifelse(is.na(v4_clin$v4_ausschluss1_rekr_datum), NA,
                        ifelse((is.na(v4_itm_leq_chk_clin) | v4_itm_leq_chk_clin!=2) & is.na(leq_clin_old_name), -999, #data but LEQ item empty -> -999
                          ifelse((is.na(v4_itm_leq_chk_clin) | v4_itm_leq_chk_clin!=2) & !is.na(leq_clin_old_name),leq_clin_old_name,NA)))
    
    v4_itm_leq_b_con<-ifelse(is.na(v4_con$v4_rekru_visit_rekr_datum), NA,
                       ifelse((is.na(v4_itm_leq_chk_con) | v4_itm_leq_chk_con!=2) & is.na(leq_con_old_name), -999, #data but LEQ item empty -> -999
                        ifelse((is.na(v4_itm_leq_chk_con) | v4_itm_leq_chk_con!=2) & !is.na(leq_con_old_name),leq_con_old_name,NA)))
    
    v4_all_itm_leq_b<-factor(c(v4_itm_leq_b_clin,v4_itm_leq_b_con),ordered=T)

    assign(leq_new_name,v4_all_itm_leq_b,envir=.GlobalEnv)
    
    descT(v4_all_itm_leq_b)}

WHOQOL-BREF Items, Visit 1

#First and second arguments w/o quotes, third with quotes
v1_quol_recode <- function(quol_clin_old_name,quol_con_old_name,quol_new_name,recode) {
    
    v1_itm_quol_chk_clin<-v1_clin$v1_whoqol_bref_verwer_fragebogen
    v1_itm_quol_chk_con<-v1_con$v1_whoqol_bref_whoqol_korrekt
    
    v1_itm_quol_clin<-ifelse((is.na(v1_itm_quol_chk_clin) | v1_itm_quol_chk_clin!=2),
                  quol_clin_old_name,NA) 
    
    v1_itm_quol_con<-ifelse((is.na(v1_itm_quol_chk_con) | v1_itm_quol_chk_con!=2),
                  quol_con_old_name,NA)               
    
    if(recode==0) {v1_all_itm_quol<-factor(c(v1_itm_quol_clin,v1_itm_quol_con),ordered=T)}
    else          {v1_all_itm_quol<-factor(6-c(v1_itm_quol_clin,v1_itm_quol_con),ordered=T)}
                      
    assign(quol_new_name,v1_all_itm_quol,envir=.GlobalEnv)
    
    desc(v1_all_itm_quol)}

WHOQOL-BREF Items, Visit 2

#First and second arguments w/o quotes, third with quotes
v2_quol_recode <- function(quol_clin_old_name,quol_con_old_name,quol_new_name,recode) {
    
    v2_itm_quol_chk_clin<-v2_clin$v2_whoqol_bref_verwer_fragebogen
    v2_itm_quol_chk_con<-v2_con$v2_whoqol_bref_whoqol_korrekt
    
    v2_itm_quol_clin<-ifelse((is.na(v2_itm_quol_chk_clin) | v2_itm_quol_chk_clin!=2),
                  quol_clin_old_name,NA) 
    
    v2_itm_quol_con<-ifelse((is.na(v2_itm_quol_chk_con) | v2_itm_quol_chk_con!=2),
                  quol_con_old_name,NA)               
    
    if(recode==0) {v2_all_itm_quol<-factor(c(v2_itm_quol_clin,v2_itm_quol_con),ordered=T)}
    else          {v2_all_itm_quol<-factor(6-c(v2_itm_quol_clin,v2_itm_quol_con),ordered=T)}
                      
    assign(quol_new_name,v2_all_itm_quol,envir=.GlobalEnv)
    
    desc(v2_all_itm_quol)}

WHOQOL-BREF Items, Visit 3

#First and second arguments w/o quotes, third with quotes
v3_quol_recode <- function(quol_clin_old_name,quol_con_old_name,quol_new_name,recode) {
    
    v3_itm_quol_chk_clin<-v3_clin$v3_whoqol_bref_verwer_fragebogen
    v3_itm_quol_chk_con<-v3_con$v3_whoqol_bref_whoqol_korrekt
    
    v3_itm_quol_clin<-ifelse((is.na(v3_itm_quol_chk_clin) | v3_itm_quol_chk_clin!=2),
                  quol_clin_old_name,NA) 
    
    v3_itm_quol_con<-ifelse((is.na(v3_itm_quol_chk_con) | v3_itm_quol_chk_con!=2),
                  quol_con_old_name,NA)               
    
    if(recode==0) {v3_all_itm_quol<-factor(c(v3_itm_quol_clin,v3_itm_quol_con),ordered=T)}
    else          {v3_all_itm_quol<-factor(6-c(v3_itm_quol_clin,v3_itm_quol_con),ordered=T)}
                      
    assign(quol_new_name,v3_all_itm_quol,envir=.GlobalEnv)
    
    desc(v3_all_itm_quol)}

WHOQOL-BREF Items, Visit 4

#First and second arguments w/o quotes, third with quotes
v4_quol_recode <- function(quol_clin_old_name,quol_con_old_name,quol_new_name,recode) {
    
    v4_itm_quol_chk_clin<-v4_clin$v4_whoqol_bref_verwer_fragebogen
    v4_itm_quol_chk_con<-v4_con$v4_whoqol_bref_whoqol_korrekt
    
    v4_itm_quol_clin<-ifelse((is.na(v4_itm_quol_chk_clin) | v4_itm_quol_chk_clin!=2),
                  quol_clin_old_name,NA) 
    
    v4_itm_quol_con<-ifelse((is.na(v4_itm_quol_chk_con) | v4_itm_quol_chk_con!=2),
                  quol_con_old_name,NA)               
    
    if(recode==0) {v4_all_itm_quol<-factor(c(v4_itm_quol_clin,v4_itm_quol_con),ordered=T)}
    else          {v4_all_itm_quol<-factor(6-c(v4_itm_quol_clin,v4_itm_quol_con),ordered=T)}
                      
    assign(quol_new_name,v4_all_itm_quol,envir=.GlobalEnv)
    
    desc(v4_all_itm_quol)}

Big Five Personality Items

#First and second arguments w/o quotes, third with quotes
big_five_recode <- function(big_five_clin_old_name,big_five_con_old_name,big_five_new_name,recode) {
    
    itm_big_five_chk_clin<-v1_clin$v1_bfi_10_verwer_fragebogen
    itm_big_five_chk_con<-v1_con$v1_bfi_10_bfi_korrekt
    
    itm_big_five_clin<-ifelse((is.na(itm_big_five_chk_clin) | itm_big_five_chk_clin!=2),
                  big_five_clin_old_name,NA) 
    
    itm_big_five_con<-ifelse((is.na(itm_big_five_chk_con) | itm_big_five_chk_con!=2),
                  big_five_con_old_name,NA)               
    
    if(recode==0) {all_itm_big_five<-factor(c(itm_big_five_clin,itm_big_five_con),ordered=T)}
    else          {all_itm_big_five<-factor(6-c(itm_big_five_clin,itm_big_five_con),ordered=T)}
                      
    assign(big_five_new_name,all_itm_big_five,envir=.GlobalEnv)
    
    desc(all_itm_big_five)}

Life event between study visits, LEQ item number, Visit 2

leq_event_recode_v2<- function(leq_ev_old_name,leq_ev_new_name) {
  
  leq_itm_no<-c(rep(NA,dim(v2_clin)[1]),rep(-999,dim(v2_con)[1]))
  
  leq_itm_no<-ifelse(v2_clin_ill_ep_snc_lst=="Y" & is.na(c(leq_ev_old_name,rep(-999,dim(v2_con)[1])))==F,
                            c(leq_ev_old_name,rep(-999,dim(v2_con)[1])),
                            
                        ifelse((v2_clin_ill_ep_snc_lst=="Y" & is.na(c(leq_ev_old_name,rep(-999,dim(v2_con)[1])))) |              
                                 v2_clin_ill_ep_snc_lst=="N" | v2_clin_ill_ep_snc_lst=="C",-999,leq_itm_no))

  leq_itm_no<-factor(leq_itm_no)
  assign(leq_ev_new_name,leq_itm_no,envir=.GlobalEnv)
  descT(leq_itm_no)}

Life event between study visits, LEQ item number, Visit 3

leq_event_recode_v3<- function(leq_ev_old_name,leq_ev_new_name) {
  
  leq_itm_no<-c(rep(NA,dim(v3_clin)[1]),rep(-999,dim(v3_con)[1]))
  
  leq_itm_no<-ifelse(v3_clin_ill_ep_snc_lst=="Y" & is.na(c(leq_ev_old_name,rep(-999,dim(v3_con)[1])))==F,
                            c(leq_ev_old_name,rep(-999,dim(v3_con)[1])),
                            
                        ifelse((v3_clin_ill_ep_snc_lst=="Y" & is.na(c(leq_ev_old_name,rep(-999,dim(v3_con)[1])))) |              
                                 v3_clin_ill_ep_snc_lst=="N" | v3_clin_ill_ep_snc_lst=="C",-999,leq_itm_no))

  leq_itm_no<-factor(leq_itm_no)
  assign(leq_ev_new_name,leq_itm_no,envir=.GlobalEnv)
  descT(leq_itm_no)}

Life event between study visits, LEQ item number, Visit 4

leq_event_recode_v4<- function(leq_ev_old_name,leq_ev_new_name) {
  
  leq_itm_no<-c(rep(NA,dim(v4_clin)[1]),rep(-999,dim(v4_con)[1]))
  
  leq_itm_no<-ifelse(v4_clin_ill_ep_snc_lst=="Y" & is.na(c(leq_ev_old_name,rep(-999,dim(v4_con)[1])))==F,
                            c(leq_ev_old_name,rep(-999,dim(v4_con)[1])),
                            
                        ifelse((v4_clin_ill_ep_snc_lst=="Y" & is.na(c(leq_ev_old_name,rep(-999,dim(v4_con)[1])))) |              
                                 v4_clin_ill_ep_snc_lst=="N" | v4_clin_ill_ep_snc_lst=="C",-999,leq_itm_no))

  leq_itm_no<-factor(leq_itm_no)
  assign(leq_ev_new_name,leq_itm_no,envir=.GlobalEnv)
  descT(leq_itm_no)}

Life events between study visits, occurred before illness episode, Visit 2

#First argument w/o quotes, second with quotes
b4_event_recode_v2<- function(between_clin_old_name,between_new_name) {
  
  itm_btw<-c(rep(NA,dim(v2_clin)[1]),rep(-999,dim(v2_con)[1]))
  
  itm_btw<-ifelse(v2_clin_ill_ep_snc_lst=="Y" & c(between_clin_old_name,rep(-999,dim(v2_con)[1]))==1,"Y",
                         ifelse(v2_clin_ill_ep_snc_lst=="Y" & c(between_clin_old_name,rep(-999,dim(v2_con)[1]))==2,"N",-999))
                              
  itm_btw<-factor(itm_btw)
  assign(between_new_name,itm_btw,envir=.GlobalEnv)
  descT(itm_btw)}

Life events between study visits, occurred before illness episode, Visit 3

#First argument w/o quotes, second with quotes
b4_event_recode_v3<- function(between_clin_old_name,between_new_name) {
  
  itm_btw<-c(rep(NA,dim(v3_clin)[1]),rep(-999,dim(v3_con)[1]))
  
  itm_btw<-ifelse(v3_clin_ill_ep_snc_lst=="Y" & c(between_clin_old_name,rep(-999,dim(v3_con)[1]))==1,"Y",
                         ifelse(v3_clin_ill_ep_snc_lst=="Y" & c(between_clin_old_name,rep(-999,dim(v3_con)[1]))==2,"N",-999))
                              
  itm_btw<-factor(itm_btw)
  assign(between_new_name,itm_btw,envir=.GlobalEnv)
  descT(itm_btw)}

Life events between study visits, occurred before illness episode, Visit 4

#First argument w/o quotes, second with quotes
b4_event_recode_v4<- function(between_clin_old_name,between_new_name) {
  
  itm_btw<-c(rep(NA,dim(v4_clin)[1]),rep(-999,dim(v4_con)[1]))
  
  itm_btw<-ifelse(v4_clin_ill_ep_snc_lst=="Y" & c(between_clin_old_name,rep(-999,dim(v4_con)[1]))==1,"Y",
                         ifelse(v4_clin_ill_ep_snc_lst=="Y" & c(between_clin_old_name,rep(-999,dim(v4_con)[1]))==2,"N",-999))
                              
  itm_btw<-factor(itm_btw)
  assign(between_new_name,itm_btw,envir=.GlobalEnv)
  descT(itm_btw)}

Life events between study visits, was a preciptitating factor, Visit 2

#First argument w/o quotes, second with quotes
prcp_event_recode_v2<- function(prcp_clin_old_name,prcp_new_name) {
  
  itm_prcp<-c(rep(NA,dim(v2_clin)[1]),rep(-999,dim(v2_con)[1]))
  
  itm_prcp<-ifelse(v2_clin_ill_ep_snc_lst=="Y" & c(prcp_clin_old_name,rep(-999,dim(v2_con)[1]))==1,"Y",
                         ifelse(v2_clin_ill_ep_snc_lst=="Y" & c(prcp_clin_old_name,rep(-999,dim(v2_con)[1]))==2,"N",
                              ifelse(v2_clin_ill_ep_snc_lst=="Y" & c(prcp_clin_old_name,rep(-999,dim(v2_con)[1]))==3,"U",-999))) 
                                
  itm_prcp<-factor(itm_prcp)
  assign(prcp_new_name,itm_prcp,envir=.GlobalEnv)
  descT(itm_prcp)}

Life events between study visits, was a preciptitating factor, Visit 3

#First argument w/o quotes, second with quotes
prcp_event_recode_v3<- function(prcp_clin_old_name,prcp_new_name) {
  
  itm_prcp<-c(rep(NA,dim(v3_clin)[1]),rep(-999,dim(v3_con)[1]))
  
  itm_prcp<-ifelse(v3_clin_ill_ep_snc_lst=="Y" & c(prcp_clin_old_name,rep(-999,dim(v3_con)[1]))==1,"Y",
                         ifelse(v3_clin_ill_ep_snc_lst=="Y" & c(prcp_clin_old_name,rep(-999,dim(v3_con)[1]))==2,"N",
                              ifelse(v3_clin_ill_ep_snc_lst=="Y" & c(prcp_clin_old_name,rep(-999,dim(v3_con)[1]))==3,"U",-999))) 
                                
  itm_prcp<-factor(itm_prcp)
  assign(prcp_new_name,itm_prcp,envir=.GlobalEnv)
  descT(itm_prcp)}

Life events between study visits, was a preciptitating factor, Visit 4

#First argument w/o quotes, second with quotes
prcp_event_recode_v4<- function(prcp_clin_old_name,prcp_new_name) {
  
  itm_prcp<-c(rep(NA,dim(v4_clin)[1]),rep(-999,dim(v4_con)[1]))
  
  itm_prcp<-ifelse(v4_clin_ill_ep_snc_lst=="Y" & c(prcp_clin_old_name,rep(-999,dim(v4_con)[1]))==1,"Y",
                         ifelse(v4_clin_ill_ep_snc_lst=="Y" & c(prcp_clin_old_name,rep(-999,dim(v4_con)[1]))==2,"N",
                              ifelse(v4_clin_ill_ep_snc_lst=="Y" & c(prcp_clin_old_name,rep(-999,dim(v4_con)[1]))==3,"U",-999))) 
                                
  itm_prcp<-factor(itm_prcp)
  assign(prcp_new_name,itm_prcp,envir=.GlobalEnv)
  descT(itm_prcp)}

Childhood Trauma Screener

#First and second arguments w/o quotes, third with quotes
cts_recode <- function(cts_clin_old_name,cts_con_old_name,cts_new_name,recode) {
    
    itm_cts_chk_clin<-v3_clin$v3_chidlhood_verwer_fragebogen
    itm_cts_chk_con<-v3_con$v3_chidlhood_childhood_korrekt
    
    itm_cts_clin<-ifelse((is.na(itm_cts_chk_clin) | itm_cts_chk_clin!=2),
                  cts_clin_old_name,NA) 
    
    itm_cts_clin[itm_cts_clin==0]<-NA #important only with clinical participants!
    
    itm_cts_con<-ifelse((is.na(itm_cts_chk_con) | itm_cts_chk_con!=2),
                  cts_con_old_name,NA)               
    
    if(recode==0) {all_itm_cts<-factor(c(itm_cts_clin,itm_cts_con),ordered=T)}
    else          {all_itm_cts<-factor(6-c(itm_cts_clin,itm_cts_con),ordered=T)}
                      
    assign(cts_new_name,all_itm_cts,envir=.GlobalEnv)
    
    desc(all_itm_cts)}

Visit 1: Data preparation

Read in data of clinical participants and show number

## [1] 1223

Read in data of control participants and show number

## [1] 320

Visit 1: Recruitment data (code partly not shown)

Create participant identity variable (categorical [id], v1_id)

Create clinical/control status variable (categorical [stat], v1_stat)

Create date of interview variable (categorical [year-month-day], v1_interv_date)

Create recruitment center variable (categorical [see below], v1_center)

Clinical participants

Control participants

Conbine clincal and control participants Code as factor

v1_center<-factor(c(v1_clin_center,v1_con_center),ordered=F)

Number of participants (clinical and control combined) by recruitment center

descT(v1_center)
##                1   2   3   4   5   6  7   10  11  12  13  14   16  18  19 
## [1,] No. cases 19  39  11  5   41  62 32  7   13  36  13  257  370 101 100
## [2,] Percent   1.2 2.5 0.7 0.3 2.7 4  2.1 0.5 0.8 2.3 0.8 16.7 24  6.5 6.5
##      20  21  22  23      
## [1,] 147 148 98  44  1543
## [2,] 9.5 9.6 6.4 2.9 100
par(mar=c(5.1,4.1,2.1,0))
ctr<-barplot(table(v1_center),las=2,ylim=c(0,400),lwd=2,horiz=F,axisnames=F, ylab="Number of baseline interviews")
nmctr<-names(table(v1_center))
text(ctr, par("usr")[3], labels=nmctr, srt = 45, adj = c(1.1,1.1), xpd = TRUE, cex=.8)

Interviewers (categorical, v1_tstlt)

Interviewers were de-identified due to data protection requirements.

Clinical participants

Control participants

Conbine clincal and control participants

v1_tstlt<-as.factor(c(as.character(v1_clin_int),as.character(v1_con_int)))

Determine number of interviewers (teams counted as separate raters)

length(unique(v1_tstlt)) 
## [1] 86

Determine number of rater teams

length(unique(v1_tstlt)) #(NB: rater teams counted as separate interviewer)
## [1] 86

Create dataset

v1_rec<-data.frame(v1_stat,v1_center,v1_tstlt,v1_interv_date) 

Visit 1: Demographic information

Sex (dichotomous [M,F], v1_sex)

v1_clin_sex<-ifelse(v1_clin$v1_demogr_s1_dem1_ses01_geschl==1,"M","F")
v1_con_sex<-ifelse(v1_con$v1_demo1_sex==1,"M","F")
v1_sex<-c(v1_clin_sex,v1_con_sex)
v1_sex<-as.factor(v1_sex)

descT(v1_sex) 
##                F    M        
## [1,] No. cases 758  785  1543
## [2,] Percent   49.1 50.9 100

Age at first interview (continuous [years], v1_age)

v1_age_years_clin<-as.numeric(substr(v1_clin$v1_ausschluss_rekr_datum,1,4))-as.numeric(substr(v1_clin$v1_demogr_s1_dem2_ses02_geb,1,4))
v1_age_years_clin[v1_age_years_clin==-54]<-46 #correct age of one participant, typo in phenotype database

v1_age_years_con<-as.numeric(substr(v1_con$v1_rek_rekrdat,1,4))-as.numeric(substr(v1_con$v1_demo1_gebdat,1,4))

v1_age_years<-c(v1_age_years_clin,v1_age_years_con)

v1_age<-ifelse(c(as.numeric(substr(v1_clin$v1_ausschluss_rekr_datum,5,6)),as.numeric(substr(v1_con$v1_rek_rekrdat,5,6)))<
                 c(as.numeric(substr(v1_clin$v1_demogr_s1_dem2_ses02_geb,5,6)),as.numeric(substr(v1_con$v1_demo1_gebdat,5,6))),
                   v1_age_years-1,v1_age_years)
summary(v1_age) 
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    18.0    29.5    42.0    41.6    52.0    86.0

Year of birth (continuous [year], v1_yob)

v1_yob_clin<-as.integer(substr(v1_clin$v1_demogr_s1_dem2_ses02_geb,1,4))
v1_yob_con<-as.integer(substr(v1_con$v1_demo1_gebdat,1,4))
v1_yob<-c(v1_yob_clin,v1_yob_con)
summary(v1_yob) 
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    1931    1962    1972    1973    1985    1998

Season of birth (categorical [spring, summer, fall, winter], v1_seas_birth)

v1_seas_birth_clin<-rep(NA,dim(v1_clin)[1])

v1_seas_birth_clin<-ifelse(substr(v1_clin$v1_demogr_s1_dem2_ses02_geb,5,6) %in% c("03","04","05"), "Spring", 
                   ifelse(substr(v1_clin$v1_demogr_s1_dem2_ses02_geb,5,6) %in% c("06","07","08"), "Summer",  
                      ifelse(substr(v1_clin$v1_demogr_s1_dem2_ses02_geb,5,6) %in% c("09","10","11"), "Fall", 
                         ifelse(substr(v1_clin$v1_demogr_s1_dem2_ses02_geb,5,6) %in% c("12","01","02"),"Winter", v1_seas_birth_clin))))

table(v1_seas_birth_clin)
## v1_seas_birth_clin
##   Fall Spring Summer Winter 
##    319    311    294    299
v1_seas_birth_con<-rep(NA,dim(v1_con)[1])

v1_seas_birth_con<-ifelse(substr(v1_con$v1_demo1_gebdat,5,6) %in% c("03","04","05"), "Spring", 
                   ifelse(substr(v1_con$v1_demo1_gebdat,5,6) %in% c("06","07","08"), "Summer",  
                      ifelse(substr(v1_con$v1_demo1_gebdat,5,6) %in% c("09","10","11"), "Fall", 
                         ifelse(substr(v1_con$v1_demo1_gebdat,5,6) %in% c("12","01","02"),"Winter", v1_seas_birth_con))))

table(v1_seas_birth_con)
## v1_seas_birth_con
##   Fall Spring Summer Winter 
##     74     99     77     70
v1_seas_birth<-c(v1_seas_birth_clin,v1_seas_birth_con)

v1_seas_birth<-as.factor(v1_seas_birth)
table(v1_seas_birth)
## v1_seas_birth
##   Fall Spring Summer Winter 
##    393    410    371    369

Age of parents at birth

Age of mother at birth (continuous [years], v1_age_m_birth)

v1_age_m_birth_clin<-as.integer(substr(v1_clin$v1_demogr_s1_dem2_ses02_geb,1,4))-as.integer(
  substr(v1_clin$v1_demogr_s1_dem4_geb_m,1,4))

v1_age_m_birth_clin[v1_age_m_birth_clin==0]<-NA #set one case of 0 to NA

v1_age_m_birth_con<-as.integer(substr(v1_con$v1_demo1_gebdat,1,4))-as.integer(substr(v1_con$v1_demo1_mgebdat,1,4))

v1_age_m_birth<-c(v1_age_m_birth_clin,v1_age_m_birth_con)
summary(v1_age_m_birth)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   12.00   24.00   28.00   28.11   31.00   49.00     118

Age of father at birth (continuous [years], v1_age_f_birth)

v1_age_f_birth_clin<-as.integer(substr(v1_clin$v1_demogr_s1_dem2_ses02_geb,1,4))-as.integer(substr(v1_clin$v1_demogr_s1_dem5_geb_v,1,4))
v1_age_f_birth_con<-as.integer(substr(v1_con$v1_demo1_gebdat,1,4))-as.integer(substr(v1_con$v1_demo1_vgebdat,1,4))

v1_age_f_birth<-c(v1_age_f_birth_clin,v1_age_f_birth_con)
summary(v1_age_f_birth)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##    13.0    27.0    31.0    31.9    36.0    62.0     195

Marital status (categorical [married, married but living separately, single, divorced, widowed], v1_marital_stat)

v1_mar_clin<-v1_clin$v1_demogr_s1_dem6_ses12_famstand
v1_mar_con<-v1_con$v1_demo1_famstand

cat_mar<-c("Married","Married_living_sep","Single","Divorced","Widowed")

v1_marital_stat_clin<-cat_mar[v1_mar_clin]
v1_marital_stat_con<-cat_mar[v1_mar_con]

v1_marital_stat<-as.factor(c(v1_marital_stat_clin,v1_marital_stat_con))
descT(v1_marital_stat)
##                Divorced Married Married_living_sep Single Widowed <NA>
## [1,] No. cases 213      343     67                 881    21      18  
## [2,] Percent   13.8     22.2    4.3                57.1   1.4     1.2 
##          
## [1,] 1543
## [2,] 100

Relationship status

“Do you currently have a partner?” (dichotomous, v1_partner)

v1_clin_partner<-ifelse(v1_clin$v1_demogr_s1_dem9_ses13_partner==1,"Y","N")
v1_con_partner<-ifelse(v1_con$v1_demo1_partner==1,"Y","N")

v1_partner<-as.factor(c(v1_clin_partner,v1_con_partner))
desc(v1_partner)
##                N    Y    NA's     
## [1,] No. cases 759  742  42   1543
## [2,] Percent   49.2 48.1 2.7  100

Children

Biological (continuous [number], v1_no_bio_chld)

v1_no_bio_chld<-c(v1_clin$v1_demogr_s1_dem10_ses15a_lkind,v1_con$v1_demo1_lkind)
descT(v1_no_bio_chld)
##                0    1    2    3   4   5   <NA>     
## [1,] No. cases 939  265  195  89  26  3   26   1543
## [2,] Percent   60.9 17.2 12.6 5.8 1.7 0.2 1.7  100

Non-biological

Adoptive children (continuous [number], v1_no_adpt_chld)

v1_no_adpt_chld<-c(v1_clin$v1_demogr_s1_dem11_ses15b_akind,v1_con$v1_demo1_adkind)
descT(v1_no_adpt_chld)  
##                0    1   2   <NA>     
## [1,] No. cases 1496 2   2   43   1543
## [2,] Percent   97   0.1 0.1 2.8  100

Step children (continuous [number], v1_stp_chld)

v1_stp_chld<-c(v1_clin$v1_demogr_s1_dem12_skind,v1_con$v1_demo1_stkind)
descT(v1_stp_chld)      
##                0    1   2   3   4   <NA>     
## [1,] No. cases 1439 24  26  7   2   45   1543
## [2,] Percent   93.3 1.6 1.7 0.5 0.1 2.9  100

Siblings

Full siblings

Brothers (continuous [number], v1_brothers)

v1_brothers<-c(v1_clin$v1_demogr_s1_dem13_brueder,v1_con$v1_demo1_bruder)
descT(v1_brothers)      
##                0    1   2    3  4   5   6   7   <NA>     
## [1,] No. cases 583  586 198  62 20  7   2   1   84   1543
## [2,] Percent   37.8 38  12.8 4  1.3 0.5 0.1 0.1 5.4  100

Sisters (continuous [number], v1_sisters)

v1_sisters<-c(v1_clin$v1_demogr_s1_dem13_schwestern,v1_con$v1_demo1_schwester)
descT(v1_sisters)       
##                0   1    2    3   4   5   6   7   8   <NA>     
## [1,] No. cases 648 543  182  49  7   11  2   2   1   98   1543
## [2,] Percent   42  35.2 11.8 3.2 0.5 0.7 0.1 0.1 0.1 6.4  100

Half-siblings

Half-brothers (continuous [number], v1_hlf_brthrs)

v1_hlf_brthrs<-c(v1_clin$v1_demogr_s1_dem13_halbbrueder,v1_con$v1_demo1_hbruder)
descT(v1_hlf_brthrs)    
##                0    1   2   3  4   5   6   <NA>     
## [1,] No. cases 1193 100 34  16 2   1   1   196  1543
## [2,] Percent   77.3 6.5 2.2 1  0.1 0.1 0.1 12.7 100

Half-sisters (continuous [number], v1_hlf_sstrs)

v1_hlf_sstrs<-c(v1_clin$v1_demogr_s1_dem13_halbschwestern,v1_con$v1_demo1_hschwester)
descT(v1_hlf_sstrs) 
##                0    1   2   3   4   5   6   9   <NA>     
## [1,] No. cases 1184 111 33  9   6   3   1   1   195  1543
## [2,] Percent   76.7 7.2 2.1 0.6 0.4 0.2 0.1 0.1 12.6 100

Non-biological siblings

Step-brothers (continuous [number], v1_stp_brthrs)

v1_stp_brthrs<-c(v1_clin$v1_demogr_s1_dem13_as_brueder,v1_con$v1_demo1_adbrueder)
descT(v1_stp_brthrs) 
##                0    1   2   3   <NA>     
## [1,] No. cases 1297 29  8   1   208  1543
## [2,] Percent   84.1 1.9 0.5 0.1 13.5 100

Step-sisters (continuous [number], v1_stp_sstrs)

v1_stp_sstrs<-c(v1_clin$v1_demogr_s1_dem13_as_schwestern,v1_con$v1_demo1_adschwester)
descT(v1_stp_sstrs)
##                0    1   2   3   <NA>     
## [1,] No. cases 1292 29  10  2   210  1543
## [2,] Percent   83.7 1.9 0.6 0.1 13.6 100

Twins

“Do you have a first degree relative who is a twin?” (dichotomous, v1_twin_fam)

v1_clin_twin_fam<-ifelse(v1_clin$v1_demogr_s1_dem14_zwillinge==1,"Y","N")   
v1_con_twin_fam<-ifelse(v1_con$v1_demo1_zwillinge==1,"Y","N")   
v1_twin_fam<-as.factor(c(v1_clin_twin_fam,v1_con_twin_fam))

descT(v1_twin_fam)
##                N    Y   <NA>     
## [1,] No. cases 1355 153 35   1543
## [2,] Percent   87.8 9.9 2.3  100

“Are you a twin yourself?” (dichotomous, v1_twin_slf)

v1_clin_twin_slf<-ifelse(v1_clin$v1_demogr_s1_dem15_selbst_zwill==1,"Y","N")
v1_con_twin_slf<-ifelse(v1_con$v1_demo1_szwilling==1,"Y","N")
v1_twin_slf<-as.factor(c(v1_clin_twin_slf,v1_con_twin_slf))

descT(v1_twin_slf)
##                N    Y  <NA>     
## [1,] No. cases 1464 47 32   1543
## [2,] Percent   94.9 3  2.1  100

Living alone (dichotomous, v1_liv_aln)

v1_clin_liv_aln<-ifelse(v1_clin$v1_demogr_s1_dem17_allein==1,"Y","N")   
v1_con_liv_aln<-ifelse(v1_con$v1_demo1_allein==1,"Y","N")   
v1_liv_aln<-as.factor(c(v1_clin_liv_aln,v1_con_liv_aln))

descT(v1_liv_aln)
##                N    Y        
## [1,] No. cases 958  585  1543
## [2,] Percent   62.1 37.9 100

Education

Status in the German educational system is assessed in detail. However, many specialized types of German schools are unknown to English-speaking investigators and detailed information does not seem to play a role. Furthermore, high-school and professional education are assessed seperately in the interview. In order to combine the aforementioned types of education, we have transformed both scales to values that can be added together to form an “Educational status” variable. High-school level education was transformed into an ordinal scale from 0 to 3 (people still in high school at the time of the interview are give NA). Professional eduction is also transformed into an ordinal scale from 0 to 3. These two scales are added together to give an ordinal educational status scale ranging from 0 to 6.

High-school level education (ordinal [0,1,2,3], v1_school)

The following transformation was used: “no information”/“missing”-NA, “no graduation”-0, “Hauptschule”-1, “Realschule”-2, “Polytechnische Oberschule”-2, “Fachhochschule”-3, “Allgemeine Hochschulreife”-3; still in school“/”other degree“- -999.

NB: Transformation to ordered factor below, after creation of v1_ed_status variable.

v1_clin_school<-rep(NA,dim(v1_clin)[1])
v1_con_school<-rep(NA,dim(v1_con)[1])

v1_clin_school<-ifelse(v1_clin$v1_demogr_s2_dem18_ses18_sabschl %in% c(1:2),v1_clin$v1_demogr_s2_dem18_ses18_sabschl-1,v1_clin_school)
v1_clin_school<-ifelse(v1_clin$v1_demogr_s2_dem18_ses18_sabschl %in% c(3:4),2,v1_clin_school)
v1_clin_school<-ifelse(v1_clin$v1_demogr_s2_dem18_ses18_sabschl %in% c(5:6),3,v1_clin_school)
v1_clin_school<-ifelse(v1_clin$v1_demogr_s2_dem18_ses18_sabschl %in% c(7:8),-999,v1_clin_school)

v1_con_school<-ifelse(v1_con$v1_demo2_abschl %in% c(1:2),v1_con$v1_demo2_abschl-1,v1_con_school)
v1_con_school<-ifelse(v1_con$v1_demo2_abschl %in% c(3:4),2,v1_con_school)
v1_con_school<-ifelse(v1_con$v1_demo2_abschl %in% c(5:6),3,v1_con_school)
v1_con_school<-ifelse(v1_con$v1_demo2_abschl %in% c(7:8),-999,v1_con_school)

v1_school<-c(v1_clin_school,v1_con_school)
descT(v1_school)
##                -999 0   1   2   3    <NA>     
## [1,] No. cases 17   24  278 371 838  15   1543
## [2,] Percent   1.1  1.6 18  24  54.3 1    100

Professional education (ordinal [0,1,2,3], v1_prof_dgr)

The following transformation was used: missing or no information-NA, “no professional education”/“beruflich-betriebliche Anlernzeit, aber keine Lehre; Teilfacharbeiterabschluss”/“in professional education”-0, “Lehre”-1, “beruflich-betriebliche Ausbildung”/“beruflich-schulische Ausbildung”-2, “Fachhochschul-/Universitätsabschluss”-3, “other professional degree” - -999,

NB: Transformation to ordered factor below, after creation of v1_ed_status variable.

v1_clin_prof_dgr<-rep(NA,dim(v1_clin)[1])
v1_con_prof_dgr<-rep(NA,dim(v1_con)[1])

v1_clin_prof_dgr<-ifelse(v1_clin$v1_demogr_s2_dem19_ses19_aba==1,-999,v1_clin_prof_dgr) 
v1_clin_prof_dgr<-ifelse(v1_clin$v1_demogr_s2_dem19_ses19_kba==1,0,v1_clin_prof_dgr)    
v1_clin_prof_dgr<-ifelse(v1_clin$v1_demogr_s2_dem19_ses19_anlern==1,0,v1_clin_prof_dgr) 
v1_clin_prof_dgr<-ifelse(v1_clin$v1_demogr_s2_dem19_ses19_in_ausb==1,0,v1_clin_prof_dgr)
v1_clin_prof_dgr<-ifelse(v1_clin$v1_demogr_s2_dem19_ses19_lehre==1,1,v1_clin_prof_dgr)  
v1_clin_prof_dgr<-ifelse(v1_clin$v1_demogr_s2_dem19_ses19_ausb==1,2,v1_clin_prof_dgr)   
v1_clin_prof_dgr<-ifelse(v1_clin$v1_demogr_s2_dem19_ses19_fachs==1,2,v1_clin_prof_dgr)  
v1_clin_prof_dgr<-ifelse(v1_clin$v1_demogr_s2_dem19_ses19_fh_uni==1,3,v1_clin_prof_dgr)

v1_con_prof_dgr<-ifelse(v1_con$v1_demo2_a_babschl==1,-999,v1_con_prof_dgr)  
v1_con_prof_dgr<-ifelse(v1_con$v1_demo2_kba==1,0,v1_con_prof_dgr)   
v1_con_prof_dgr<-ifelse(v1_con$v1_demo2_anlern==1,0,v1_con_prof_dgr)    
v1_con_prof_dgr<-ifelse(v1_con$v1_demo2_ausbild==1,0,v1_con_prof_dgr)
v1_con_prof_dgr<-ifelse(v1_con$v1_demo2_lehre==1,1,v1_con_prof_dgr) 
v1_con_prof_dgr<-ifelse(v1_con$v1_demo2_ausb==1,2,v1_con_prof_dgr)  
v1_con_prof_dgr<-ifelse(v1_con$v1_demo2_fachs==1,2,v1_con_prof_dgr) 
v1_con_prof_dgr<-ifelse(v1_con$v1_demo2_fhuni==1,3,v1_con_prof_dgr)

v1_prof_dgr<-c(v1_clin_prof_dgr,v1_con_prof_dgr)
descT(v1_prof_dgr)
##                -999 0    1    2    3    <NA>     
## [1,] No. cases 9    398  406  332  379  19   1543
## [2,] Percent   0.6  25.8 26.3 21.5 24.6 1.2  100

Important: more than one answer is possible, as people may have several professional degrees. The order of the commands above makes sure higher professional degrees overwrite lower ones.

Educational status scale (ordinal [0,1,2,3,4,5,6], v1_ed_status)

As describe above, this scale was newly created.

v1_ed_status<-v1_school+v1_prof_dgr
v1_ed_status[v1_ed_status<0]<-NA
v1_ed_status<-factor(v1_ed_status, ordered=T)

descT(v1_ed_status)
##                0   1   2    3    4    5    6    <NA>     
## [1,] No. cases 19  82  239  390  236  164  366  47   1543
## [2,] Percent   1.2 5.3 15.5 25.3 15.3 10.6 23.7 3    100

Transform school and professional degree variables to factors.

v1_school<-factor(v1_school, ordered=T)
v1_prof_dgr<-factor(v1_prof_dgr, ordered=T)

Employment

Currently paid employment (dichotomous, v1_curr_paid_empl)

Because of several categories that are unique to the Germany labor market, several of answer categories were pooled to arrive at a more clear-cut (Y/N) answer to this question. Thr following transformations were used: “no information”-NA, “full-time”-Y, “part-time”-Y, “partial retirement”-Y, “marginal employment”-Y, “1-euro-job”-Y, “Occassionally/infrequently”-999, “in professional training”-Y, “professional retraining”-Y, “voluntary service/alternative military service”-Y, “maternity leave or other leave”-Y, “not employed”-N.

v1_clin_curr_paid_empl<-rep(NA,dim(v1_clin)[1])
v1_con_curr_paid_empl<-rep(NA,dim(v1_con)[1])

v1_clin_curr_paid_empl<-ifelse(v1_clin$v1_demogr_s2_dem20_ses20_erwbtaet %in% c(1:5,7:10),"Y",v1_clin_curr_paid_empl)
v1_clin_curr_paid_empl<-ifelse(v1_clin$v1_demogr_s2_dem20_ses20_erwbtaet %in% c(6,11),"N",v1_clin_curr_paid_empl)   

v1_con_curr_paid_empl<-ifelse(v1_con$v1_demo2_erwerb %in% c(1:5,7:10),"Y",v1_con_curr_paid_empl)
v1_con_curr_paid_empl<-ifelse(v1_con$v1_demo2_erwerb %in% c(6,11),"N",v1_con_curr_paid_empl)    

v1_curr_paid_empl<-c(v1_clin_curr_paid_empl,v1_con_curr_paid_empl)
v1_curr_paid_empl<-as.factor(v1_curr_paid_empl)
descT(v1_curr_paid_empl)
##                N    Y    <NA>     
## [1,] No. cases 815  706  22   1543
## [2,] Percent   52.8 45.8 1.4  100

Disability pension due to psychological/psychiatric illness (dichotomous, v1_disabl_pens)

v1_clin_disabl_pens<-ifelse(v1_clin$v1_demogr_s2_dem20_ses20_rente==1,"Y","N")      
v1_con_disabl_pens<-ifelse(v1_con$v1_demo2_rente==1,"Y","N")        

v1_disabl_pens<-as.factor(c(v1_clin_disabl_pens,v1_con_disabl_pens))
descT(v1_disabl_pens)
##                N    Y    <NA>     
## [1,] No. cases 764  381  398  1543
## [2,] Percent   49.5 24.7 25.8 100

Employed in workshop for handicapped persons (dichotomous, v1_spec_emp)

v1_clin_spec_emp<-ifelse(v1_clin$v1_demogr_s2_dem20_ses20_werk==1,"Y","N")          
v1_con_spec_emp<-ifelse(v1_con$v1_demo2_wfbm==1,"Y","N")            

v1_spec_emp<-as.factor(c(v1_clin_spec_emp,v1_con_spec_emp))
descT(v1_spec_emp)
##                N    Y   <NA>     
## [1,] No. cases 549  74  920  1543
## [2,] Percent   35.6 4.8 59.6 100

Months of work absence due to psychological distress in past five years (continuous [months], v1_wrk_abs_pst_5_yrs)

Cases are set ot -999 in the following cases: 1) Pension, 2) Unknown, 3) Filled out but >60 months are set to -999.

v1_clin_wrk_abs_pst_5_yrs<-ifelse((v1_clin$v1_demogr_s2_dem23_unbekannt==1 | v1_clin$v1_demogr_s2_dem23_rente==1 | v1_clin$v1_demogr_s2_dem23_arbeitsausf>60),-999, v1_clin$v1_demogr_s2_dem23_arbeitsausf)

v1_con_wrk_abs_pst_5_yrs<-ifelse((v1_con$v1_demo2_ausfallu==1 | v1_con$v1_demo2_rente==1 | v1_con$v1_demo2_ausfallm>60),-999, v1_con$v1_demo2_ausfallm) 

v1_wrk_abs_pst_5_yrs<-c(v1_clin_wrk_abs_pst_5_yrs,v1_con_wrk_abs_pst_5_yrs)
descT(v1_wrk_abs_pst_5_yrs)
##                -999 0    1   2   3   4   5  6   7   8   9   10  11  12 
## [1,] No. cases 507  334  51  65  43  32  31 50  9   20  13  19  3   40 
## [2,] Percent   32.9 21.6 3.3 4.2 2.8 2.1 2  3.2 0.6 1.3 0.8 1.2 0.2 2.6
##      13  14  15  16  17  18  20  21  22  23  24 25  26  27  28  30  33 
## [1,] 6   3   8   5   3   23  7   1   3   1   31 1   1   2   1   13  1  
## [2,] 0.4 0.2 0.5 0.3 0.2 1.5 0.5 0.1 0.2 0.1 2  0.1 0.1 0.1 0.1 0.8 0.1
##      35  36  38  42  45  48  50  52  54  60  <NA>     
## [1,] 2   14  1   3   1   13  2   1   1   39  139  1543
## [2,] 0.1 0.9 0.1 0.2 0.1 0.8 0.1 0.1 0.1 2.5 9    100

Currently impaired by psychological/psychiatric symptoms in exercising profession (dichotomous, v1_cur_work_restr)

Important: if receiving pension, this question refers to impairments in the household

v1_clin_cur_work_restr<-ifelse(v1_clin$v1_demogr_s2_dem24_arbeitseinschr==1,"Y","N")    
v1_con_cur_work_restr<-ifelse(v1_con$v1_demo2_psyeinsch==1,"Y","N") 
v1_cur_work_restr<-as.factor(c(v1_clin_cur_work_restr,v1_con_cur_work_restr))

descT(v1_cur_work_restr)
##                N    Y    <NA>     
## [1,] No. cases 652  798  93   1543
## [2,] Percent   42.3 51.7 6    100

Create dataset

v1_dem<-data.frame(v1_sex,v1_age,v1_yob,v1_seas_birth,v1_age_m_birth,v1_age_f_birth,
                   v1_marital_stat,v1_partner,v1_no_bio_chld,v1_no_adpt_chld,
                   v1_stp_chld,v1_brothers,v1_sisters,v1_hlf_brthrs,v1_hlf_sstrs,
                   v1_stp_brthrs,v1_stp_sstrs,v1_twin_fam,v1_twin_slf,v1_liv_aln,
                   v1_school,v1_prof_dgr,v1_ed_status,v1_curr_paid_empl,
                   v1_disabl_pens,v1_spec_emp,v1_wrk_abs_pst_5_yrs,v1_cur_work_restr)

Visit 1: Ethnicity

Country of birth (categorical [country], v1_cntr_brth)

v1_clin_cntr_brth<-v1_clin$v1_demogr_s2_dem25_ses03a_lst_lnd
v1_clin_cntr_brth<-ifelse(is.na(v1_clin_cntr_brth) & v1_clin$v1_demogr_s2_dem25_ses03a_land_st==1, 
                     "Deutschland",as.character(v1_clin_cntr_brth))

v1_con_cntr_brth<-v1_con$v1_demo2_land1 
v1_con_cntr_brth<-ifelse(is.na(v1_con_cntr_brth) & v1_con$v1_demo2_gebort==1, 
                     "Deutschland",as.character(v1_con$v1_con_cntr_brth))
v1_cntr_brth<-as.factor(c(v1_clin_cntr_brth,v1_con_cntr_brth))
descT(v1_cntr_brth)
##                Afghanistan Ägypten anderes Land Argentinien Äthiopien
## [1,] No. cases 1           1       1            1           2        
## [2,] Percent   0.1         0.1     0.1          0.1         0.1      
##      Australien Belarus (Weißrussland) Bosnien und Herzegowina Deutschland
## [1,] 2          1                      1                       1233       
## [2,] 0.1        0.1                    0.1                     79.9       
##      Eritrea Estland Finnland Frankreich Irak Iran, Islamische Republik
## [1,] 2       1       1        2          1    3                        
## [2,] 0.1     0.1     0.1      0.1        0.1  0.2                      
##      Italien Kasachstan Kirgisistan Kroatien Marokko
## [1,] 1       9          2           3        1      
## [2,] 0.1     0.6        0.1         0.2      0.1    
##      Mazedonien, ehem. jugoslawische Republik Mongolei Niederlande Nigeria
## [1,] 2                                        1        1           1      
## [2,] 0.1                                      0.1      0.1         0.1    
##      Österreich Pakistan Polen Rumänien Russische Föderation Senegal
## [1,] 134        1        25    10       11                   1      
## [2,] 8.7        0.1      1.6   0.6      0.7                  0.1    
##      Serbien Slowakei Slowenien Sri Lanka Tadschikistan Thailand
## [1,] 7       1        1         1         1             1       
## [2,] 0.5     0.1      0.1       0.1       0.1           0.1     
##      Tschechische Republik Türkei Ukraine Ungarn Usbekistan
## [1,] 3                     8      1       2      1         
## [2,] 0.2                   0.5    0.1     0.1    0.1       
##      Vereinigte Staaten von Amerika
## [1,] 1                             
## [2,] 0.1                           
##      Vereinigtes Königreich Großbritannien und Nordirland <NA>     
## [1,] 2                                                    57   1543
## [2,] 0.1                                                  3.7  100

Country of birth mother (categorical [country], v1_cntr_brth_m)

v1_clin_cntr_brth_m<-v1_clin$v1_demogr_s2_dem26_ses06_lm_lnd
v1_clin_cntr_brth_m<-ifelse(is.na(v1_clin_cntr_brth_m) & v1_clin$v1_demogr_s2_dem26_ses06_land_m==1, 
                       "Deutschland",as.character(v1_clin_cntr_brth_m))

v1_con_cntr_brth_m<-v1_con$v1_demo2_land2
v1_con_cntr_brth_m<-ifelse(is.na(v1_con_cntr_brth_m) & v1_con$v1_demo2_gebortm==1, 
                       "Deutschland",as.character(v1_con_cntr_brth_m))
v1_cntr_brth_m<-as.factor(c(v1_clin_cntr_brth_m,v1_con_cntr_brth_m))
descT(v1_cntr_brth_m)
##                Afghanistan Algerien anderes Land Argentinien Äthiopien
## [1,] No. cases 1           1        2            1           2        
## [2,] Percent   0.1         0.1      0.1          0.1         0.1      
##      Belarus (Weißrussland) Belgien Bosnien und Herzegowina Brasilien
## [1,] 2                      1       5                       1        
## [2,] 0.1                    0.1     0.3                     0.1      
##      Bulgarien Chile Dänemark Deutschland Eritrea Estland Finnland
## [1,] 2         2     1        1047        2       2       1       
## [2,] 0.1       0.1   0.1      67.9        0.1     0.1     0.1     
##      Frankreich Griechenland Indien Indonesien Irak
## [1,] 2          1            1      1          1   
## [2,] 0.1        0.1          0.1    0.1        0.1 
##      Iran, Islamische Republik Irland Israel Italien Japan Kasachstan
## [1,] 5                         1      1      7       1     10        
## [2,] 0.3                       0.1    0.1    0.5     0.1   0.6       
##      Kirgisistan Korea, Republik (Südkorea) Kroatien
## [1,] 1           1                          10      
## [2,] 0.1         0.1                        0.6     
##      Libysch-Arabische Dschamahirija (Libyen) Luxemburg Marokko
## [1,] 1                                        3         1      
## [2,] 0.1                                      0.2       0.1    
##      Mazedonien, ehem. jugoslawische Republik Mongolei Namibia Niederlande
## [1,] 3                                        1        2       1          
## [2,] 0.2                                      0.1      0.1     0.1        
##      Österreich Pakistan Polen Rumänien Russische Föderation
## [1,] 136        1        95    14       25                  
## [2,] 8.8        0.1      6.2   0.9      1.6                 
##      Schweiz (Confoederatio Helvetica) Senegal Serbien Singapur Slowakei
## [1,] 2                                 1       13      1        3       
## [2,] 0.1                               0.1     0.8     0.1      0.2     
##      Slowenien Spanien Sri Lanka Thailand Tschechische Republik Türkei
## [1,] 5         3       3         1        24                    19    
## [2,] 0.3       0.2     0.2       0.1      1.6                   1.2   
##      Ukraine Ungarn Usbekistan
## [1,] 10      11     1         
## [2,] 0.6     0.7    0.1       
##      Vereinigtes Königreich Großbritannien und Nordirland <NA>     
## [1,] 2                                                    45   1543
## [2,] 0.1                                                  2.9  100

Country of birth father (categorical [country], v1_cntr_brth_f)

v1_clin_cntr_brth_f<-v1_clin$v1_demogr_s2_dem27_ses07_lv_lnd
v1_clin_cntr_brth_f<-ifelse(is.na(v1_clin_cntr_brth_f)==T & v1_clin$v1_demogr_s2_dem27_ses07_land_v==1, 
                       "Deutschland",as.character(v1_clin_cntr_brth_f))

v1_con_cntr_brth_f<-v1_con$v1_demo2_land3
v1_con_cntr_brth_f<-ifelse(is.na(v1_con_cntr_brth_f)==T & v1_con$v1_demo2_gebortv==1, 
                       "Deutschland",as.character(v1_con_cntr_brth_f))

v1_cntr_brth_f<-as.factor(c(v1_clin_cntr_brth_f,v1_con_cntr_brth_f))
descT(v1_cntr_brth_f)
##                Afghanistan Ägypten anderes Land Argentinien Armenien
## [1,] No. cases 1           1       4            3           1       
## [2,] Percent   0.1         0.1     0.3          0.2         0.1     
##      Äthiopien Australien Belarus (Weißrussland) Belgien
## [1,] 1         2          1                      2      
## [2,] 0.1       0.1        0.1                    0.1    
##      Bosnien und Herzegowina Bulgarien Chile Deutschland
## [1,] 3                       3         3     1008       
## [2,] 0.2                     0.2       0.2   65.3       
##      Dominikanische Republik Eritrea Estland Frankreich Griechenland
## [1,] 1                       3       2       5          1           
## [2,] 0.1                     0.2     0.1     0.3        0.1         
##      Indien Indonesien Irak Iran, Islamische Republik Israel Italien Japan
## [1,] 1      1          1    5                         1      9       2    
## [2,] 0.1    0.1        0.1  0.3                       0.1    0.6     0.1  
##      Jemen Kasachstan Korea, Republik (Südkorea) Kroatien Libanon
## [1,] 1     9          1                          5        1      
## [2,] 0.1   0.6        0.1                        0.3      0.1    
##      Luxemburg Marokko Mazedonien, ehem. jugoslawische Republik Mongolei
## [1,] 1         2       3                                        1       
## [2,] 0.1       0.1     0.2                                      0.1     
##      Namibia Nigeria Norwegen Österreich Pakistan
## [1,] 2       1       1        143        2       
## [2,] 0.1     0.1     0.1      9.3        0.1     
##      Palästinensische Autonomiegebiete Polen Rumänien Russische Föderation
## [1,] 1                                 111   13       32                  
## [2,] 0.1                               7.2   0.8      2.1                 
##      Senegal Serbien Slowakei Slowenien Spanien Sri Lanka Tadschikistan
## [1,] 1       9       2        3         1       2         1            
## [2,] 0.1     0.6     0.1      0.2       0.1     0.1       0.1          
##      Thailand Tschechische Republik Türkei Ukraine Ungarn Usbekistan
## [1,] 1        22                    23     8       6      1         
## [2,] 0.1      1.4                   1.5    0.5     0.4    0.1       
##      Vereinigte Staaten von Amerika
## [1,] 5                             
## [2,] 0.3                           
##      Vereinigtes Königreich Großbritannien und Nordirland <NA>     
## [1,] 4                                                    59   1543
## [2,] 0.3                                                  3.8  100

Country of birth grandmother, maternal side (categorical [country], v1_cntr_brth_gmm)

v1_clin_cntr_brth_gmm<-v1_clin$v1_demogr_s2_dem28_land_gm_ms_lnd
v1_clin_cntr_brth_gmm<-ifelse(is.na(v1_clin_cntr_brth_gmm)==T & v1_clin$v1_demogr_s2_dem28_land_gm_ms==1, 
                         "Deutschland",as.character(v1_clin_cntr_brth_gmm))

v1_con_cntr_brth_gmm<-v1_con$v1_demo2_land4
v1_con_cntr_brth_gmm<-ifelse(is.na(v1_con_cntr_brth_gmm)==T & v1_con$v1_demo2_gebortgmm==1, 
                         "Deutschland",as.character(v1_con_cntr_brth_gmm))

v1_cntr_brth_gmm<-as.factor(c(v1_clin_cntr_brth_gmm,v1_con_cntr_brth_gmm))
descT(v1_cntr_brth_gmm)
##                Afghanistan anderes Land Argentinien Äthiopien
## [1,] No. cases 1           2            1           1        
## [2,] Percent   0.1         0.1          0.1         0.1      
##      Belarus (Weißrussland) Belgien Bosnien und Herzegowina Bulgarien
## [1,] 2                      1       6                       1        
## [2,] 0.1                    0.1     0.4                     0.1      
##      Chile China, Volksrepublik Dänemark Deutschland Eritrea Estland
## [1,] 2     1                    2        867         2       2      
## [2,] 0.1   0.1                  0.1      56.2        0.1     0.1    
##      Finnland Frankreich Georgien Griechenland Indien Indonesien Irak
## [1,] 2        1          1        3            2      1          1   
## [2,] 0.1      0.1        0.1      0.2          0.1    0.1        0.1 
##      Iran, Islamische Republik Israel Italien Japan Kasachstan Kolumbien
## [1,] 5                         2      7       1     5          1        
## [2,] 0.3                       0.1    0.5     0.1   0.3        0.1      
##      Korea, Republik (Südkorea) Kroatien Litauen Luxemburg Marokko
## [1,] 1                          10       2       3         1      
## [2,] 0.1                        0.6      0.1     0.2       0.1    
##      Mazedonien, ehem. jugoslawische Republik Mongolei Namibia Niederlande
## [1,] 3                                        1        1       3          
## [2,] 0.2                                      0.1      0.1     0.2        
##      Österreich Pakistan Polen Rumänien Russische Föderation Schweden
## [1,] 127        1        124   10       23                   1       
## [2,] 8.2        0.1      8     0.6      1.5                  0.1     
##      Schweiz (Confoederatio Helvetica) Senegal Serbien Slowakei Slowenien
## [1,] 3                                 1       13      2        6        
## [2,] 0.2                               0.1     0.8     0.1      0.4      
##      Spanien Sri Lanka Thailand Tschechische Republik Türkei Ukraine
## [1,] 4       3         1        32                    17     15     
## [2,] 0.3     0.2       0.1      2.1                   1.1    1      
##      Ungarn Usbekistan Vereinigte Staaten von Amerika
## [1,] 13     1          1                             
## [2,] 0.8    0.1        0.1                           
##      Vereinigtes Königreich Großbritannien und Nordirland <NA>     
## [1,] 2                                                    195  1543
## [2,] 0.1                                                  12.6 100

Country of birth grandfather, maternal side (catergorical [country], v1_cntr_brth_gfm)

v1_clin_cntr_brth_gfm<-v1_clin$v1_demogr_s2_dem29_land_gv_ms_lnd
v1_clin_cntr_brth_gfm<-ifelse(is.na(v1_clin_cntr_brth_gfm)==T & v1_clin$v1_demogr_s2_dem29_land_gv_ms==1, 
                         "Deutschland",as.character(v1_clin_cntr_brth_gfm))

v1_con_cntr_brth_gfm<-v1_con$v1_demo2_land5
v1_con_cntr_brth_gfm<-ifelse(is.na(v1_con_cntr_brth_gfm)==T & v1_con$v1_demo2_gebortgmv==1, 
                         "Deutschland",as.character(v1_con_cntr_brth_gfm))

v1_cntr_brth_gfm<-as.factor(c(v1_clin_cntr_brth_gfm,v1_con_cntr_brth_gfm))
descT(v1_cntr_brth_gfm)
##                Afghanistan anderes Land Argentinien Aserbaidschan
## [1,] No. cases 1           2            1           1            
## [2,] Percent   0.1         0.1          0.1         0.1          
##      Äthiopien Belarus (Weißrussland) Belgien Bosnien und Herzegowina
## [1,] 1         3                      1       6                      
## [2,] 0.1       0.2                    0.1     0.4                    
##      Bulgarien Chile China, Volksrepublik Dänemark Deutschland Eritrea
## [1,] 1         2     2                    1        798         2      
## [2,] 0.1       0.1   0.1                  0.1      51.7        0.1    
##      Estland Finnland Frankreich Georgien Griechenland Indien Indonesien
## [1,] 2       1        3          1        4            2      1         
## [2,] 0.1     0.1      0.2        0.1      0.3          0.1    0.1       
##      Irak Iran, Islamische Republik Israel Italien Japan Kasachstan
## [1,] 1    5                         2      6       1     5         
## [2,] 0.1  0.3                       0.1    0.4     0.1   0.3       
##      Korea, Demokratische Volksrepublik (Nordkorea)
## [1,] 1                                             
## [2,] 0.1                                           
##      Korea, Republik (Südkorea) Kroatien Luxemburg Marokko
## [1,] 1                          10       3         1      
## [2,] 0.1                        0.6      0.2       0.1    
##      Mazedonien, ehem. jugoslawische Republik Mongolei Namibia Niederlande
## [1,] 3                                        1        2       4          
## [2,] 0.2                                      0.1      0.1     0.3        
##      Österreich Pakistan Polen Rumänien Russische Föderation
## [1,] 123        1        114   9        27                  
## [2,] 8          0.1      7.4   0.6      1.7                 
##      Schweiz (Confoederatio Helvetica) Senegal Serbien Slowakei Slowenien
## [1,] 2                                 1       12      3        5        
## [2,] 0.1                               0.1     0.8     0.2      0.3      
##      Spanien Sri Lanka Thailand Tschechische Republik Türkei Ukraine
## [1,] 4       3         1        23                    18     8      
## [2,] 0.3     0.2       0.1      1.5                   1.2    0.5    
##      Ungarn Usbekistan Vereinigte Staaten von Amerika
## [1,] 14     1          1                             
## [2,] 0.9    0.1        0.1                           
##      Vereinigtes Königreich Großbritannien und Nordirland <NA>     
## [1,] 1                                                    290  1543
## [2,] 0.1                                                  18.8 100

Country of birth grandmother, paternal side (catergorical [country], v1_cntr_brth_gmf)

v1_clin_cntr_brth_gmf<-v1_clin$v1_demogr_s2_dem30_land_gm_vs_lnd
v1_clin_cntr_brth_gmf<-ifelse(is.na(v1_clin_cntr_brth_gmf)==T & v1_clin$v1_demogr_s2_dem30_land_gm_vs==1, 
                         "Deutschland",as.character(v1_clin_cntr_brth_gmf))

v1_con_cntr_brth_gmf<-v1_con$v1_demo2_land6
v1_con_cntr_brth_gmf<-ifelse(is.na(v1_con_cntr_brth_gmf)==T & v1_con$v1_demo2_gebortgvm==1, 
                         "Deutschland",as.character(v1_con_cntr_brth_gmf))

v1_cntr_brth_gmf<-as.factor(c(v1_clin_cntr_brth_gmf,v1_con_cntr_brth_gmf))
descT(v1_cntr_brth_gmf)
##                Afghanistan Ägypten anderes Land Argentinien Australien
## [1,] No. cases 1           1       5            1           1         
## [2,] Percent   0.1         0.1     0.3          0.1         0.1       
##      Belarus (Weißrussland) Belgien Bosnien und Herzegowina Bulgarien
## [1,] 1                      1       3                       2        
## [2,] 0.1                    0.1     0.2                     0.1      
##      Chile Dänemark Deutschland Dominikanische Republik Eritrea Estland
## [1,] 3     1        790         1                       3       2      
## [2,] 0.2   0.1      51.2        0.1                     0.2     0.1    
##      Frankreich Ghana Griechenland Indien Irak Iran, Islamische Republik
## [1,] 6          1     3            2      1    5                        
## [2,] 0.4        0.1   0.2          0.1    0.1  0.3                      
##      Israel Italien Japan Jemen Kasachstan Korea, Republik (Südkorea)
## [1,] 1      9       2     1     3          1                         
## [2,] 0.1    0.6     0.1   0.1   0.2        0.1                       
##      Kroatien Libanon Luxemburg Marokko
## [1,] 4        2       1         1      
## [2,] 0.3      0.1     0.1       0.1    
##      Mazedonien, ehem. jugoslawische Republik Moldawien (Republik Moldau)
## [1,] 3                                        2                          
## [2,] 0.2                                      0.1                        
##      Mongolei Namibia Niederlande Nigeria Norwegen Österreich Pakistan
## [1,] 2        1       1           1       1        135        1       
## [2,] 0.1      0.1     0.1         0.1     0.1      8.7        0.1     
##      Polen Rumänien Russische Föderation Schweiz (Confoederatio Helvetica)
## [1,] 107   11       31                   1                                
## [2,] 6.9   0.7      2                    0.1                              
##      Senegal Serbien Slowakei Slowenien Spanien Sri Lanka Südafrika
## [1,] 1       10      2        4         3       2         1        
## [2,] 0.1     0.6     0.1      0.3       0.2     0.1       0.1      
##      Thailand Tschechische Republik Türkei Ukraine Ungarn Usbekistan
## [1,] 1        28                    20     8       8      1         
## [2,] 0.1      1.8                   1.3    0.5     0.5    0.1       
##      Vereinigte Staaten von Amerika
## [1,] 4                             
## [2,] 0.3                           
##      Vereinigtes Königreich Großbritannien und Nordirland <NA>     
## [1,] 4                                                    290  1543
## [2,] 0.3                                                  18.8 100

Country of birth grandfather, paternal side (catergorical [country], v1_cntr_brth_gff)

v1_clin_cntr_brth_gff<-v1_clin$v1_demogr_s2_dem31_land_gv_vs_lnd
v1_clin_cntr_brth_gff<-ifelse(is.na(v1_clin_cntr_brth_gff)==T & v1_clin$v1_demogr_s2_dem31_land_gv_vs==1, 
                         "Deutschland",as.character(v1_clin_cntr_brth_gff))

v1_con_cntr_brth_gff<-v1_con$v1_demo2_land7
v1_con_cntr_brth_gff<-ifelse(is.na(v1_con_cntr_brth_gff)==T & v1_con$v1_demo2_gebortgvv==1, 
                         "Deutschland",as.character(v1_con_cntr_brth_gff))

v1_cntr_brth_gff<-as.factor(c(v1_clin_cntr_brth_gff,v1_con_cntr_brth_gff))
descT(v1_cntr_brth_gff)
##                Afghanistan Ägypten Algerien anderes Land Australien
## [1,] No. cases 1           1       1        5            1         
## [2,] Percent   0.1         0.1     0.1      0.3          0.1       
##      Belarus (Weißrussland) Belgien Bosnien und Herzegowina Bulgarien
## [1,] 1                      2       3                       2        
## [2,] 0.1                    0.1     0.2                     0.1      
##      Chile Deutschland Eritrea Estland Frankreich Ghana Griechenland
## [1,] 4     819         3       1       5          1     1           
## [2,] 0.3   53.1        0.2     0.1     0.3        0.1   0.1         
##      Indien Irak Iran, Islamische Republik Israel Italien Japan Jemen
## [1,] 2      1    6                         1      7       2     1    
## [2,] 0.1    0.1  0.4                       0.1    0.5     0.1   0.1  
##      Kasachstan Korea, Republik (Südkorea) Kroatien Litauen Luxemburg
## [1,] 3          1                          5        2       1        
## [2,] 0.2        0.1                        0.3      0.1     0.1      
##      Marokko Mazedonien, ehem. jugoslawische Republik Mongolei Namibia
## [1,] 1       3                                        1        2      
## [2,] 0.1     0.2                                      0.1      0.1    
##      Niederlande Nigeria Norwegen Österreich Pakistan
## [1,] 1           1       1        136        1       
## [2,] 0.1         0.1     0.1      8.8        0.1     
##      Palästinensische Autonomiegebiete Polen Rumänien Russische Föderation
## [1,] 2                                 107   11       31                  
## [2,] 0.1                               6.9   0.7      2                   
##      Senegal Serbien Slowakei Slowenien Spanien Sri Lanka Thailand
## [1,] 1       9       3        5         3       2         1       
## [2,] 0.1     0.6     0.2      0.3       0.2     0.1       0.1     
##      Tschechische Republik Türkei Ukraine Ungarn Usbekistan
## [1,] 25                    21     7       8      1         
## [2,] 1.6                   1.4    0.5     0.5    0.1       
##      Vereinigte Staaten von Amerika
## [1,] 5                             
## [2,] 0.3                           
##      Vereinigtes Königreich Großbritannien und Nordirland <NA>     
## [1,] 3                                                    268  1543
## [2,] 0.2                                                  17.4 100

Create dataset

v1_eth<-data.frame(v1_cntr_brth,v1_cntr_brth_m,v1_cntr_brth_f,v1_cntr_brth_gmm,
                  v1_cntr_brth_gfm,v1_cntr_brth_gmf,v1_cntr_brth_gff)

Visit 1: Psychiatric history

Current psychiatric treatment (ordinal [1,2,3,4], v1_cur_psy_trm)

This is an ordinal scale with four levels: “no”-1, “yes, outpatient”-2, “yes, day patient”-3, “yes, inpatient”-4.

v1_clin_cur_psy_trm<-rep(NA,dim(v1_clin)[1])
v1_con_cur_psy_trm<-rep(NA,dim(v1_con)[1])

v1_clin_cur_psy_trm<-ifelse(v1_clin$v1_psy_vorg_akt_pva1_akt_behand==0,"1",
                        ifelse(v1_clin$v1_psy_vorg_akt_pva1_akt_behand==3,"2", 
                          ifelse(v1_clin$v1_psy_vorg_akt_pva1_akt_behand==2,"3",
                            ifelse(v1_clin$v1_psy_vorg_akt_pva1_akt_behand==1,"4",v1_clin_cur_psy_trm)))) 

v1_con_cur_psy_trm<-ifelse(v1_con$v1_psyaktuel_aktbehand==0,"1",
                      ifelse(v1_con$v1_psyaktuel_aktbehand==3,"2",
                        ifelse(v1_con$v1_psyaktuel_aktbehand==2,"3",
                          ifelse(v1_con$v1_psyaktuel_aktbehand==1,"4",v1_con_cur_psy_trm))))

v1_cur_psy_trm<-ordered(as.factor(c(v1_clin_cur_psy_trm,v1_con_cur_psy_trm)))
descT(v1_cur_psy_trm)
##                1    2    3   4    <NA>     
## [1,] No. cases 352  585  73  513  20   1543
## [2,] Percent   22.8 37.9 4.7 33.2 1.3  100

Ever treated as outpatient due to any mental health reason (ordinal [1,2,3,4], v1_outpat_psy_trm)

This is an ordinal scale with four levels: “no”-1, “yes, consultation or short treatment”-2, “yes, continuous treatment for six months or numerous short episodes”-3, “yes, continuous treatment for several years or many short episodes”-4. The option “No information” was coded as “-999”.

v1_clin_outpat_psy_trm<-ifelse(v1_clin$v1_psy_vorg_akt_pva2_jemals_behand==0,-999,v1_clin$v1_psy_vorg_akt_pva2_jemals_behand)
v1_con_outpat_psy_trm<-ifelse(v1_con$v1_psyaktuel_jembehand==0,-999,v1_con$v1_psyaktuel_jembehand)

v1_outpat_psy_trm<-factor(c(v1_clin_outpat_psy_trm,v1_con_outpat_psy_trm),ordered=T)
summary(v1_outpat_psy_trm)
## -999    1    2    3    4 NA's 
##   13  320  152  134  909   15

Age at first ambulatory treatment due to any mental health reason (continuous [years], v1_age_1st_out_trm)

If controls were never treated for any mental health reason, they are coded as -999.

v1_age_1st_out_trm<-c(v1_clin$v1_psy_vorg_akt_pva3_alter_jahre,
                      ifelse(is.na(v1_con$v1_psyaktuel_alterj),-999,v1_con$v1_psyaktuel_alterj))
summary(v1_age_1st_out_trm)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##  -999.0    16.0    23.0  -166.9    32.0    73.0     103

Ever treated as inpatient or daypatient due to any mental health reason (dichotomous, v1_daypat_inpat_trm)

v1_clin_daypat_inpat_trm<-ifelse(v1_clin$v1_psy_vorg_akt_pva4_teilst_behand==1, "Y","N") 
v1_con_daypat_inpat_trm<-ifelse(v1_con$v1_psyaktuel_tstbehand==1, "Y","N") 
                           
v1_daypat_inpat_trm<-factor(c(v1_clin_daypat_inpat_trm,v1_con_daypat_inpat_trm))
descT(v1_daypat_inpat_trm)
##                N    Y    <NA>     
## [1,] No. cases 338  1187 18   1543
## [2,] Percent   21.9 76.9 1.2  100

Age at first inpatient treatment due to any mental health reason (continuous [years], v1_age_1st_inpat_trm)

v1_age_1st_inpat_trm<-c(v1_clin$v1_psy_vorg_akt_pva5_alter_jahre,
                      ifelse(is.na(v1_con$v1_psyaktuel_stalterj),-999,v1_con$v1_psyaktuel_stalterj))

summary(v1_age_1st_inpat_trm[v1_age_1st_inpat_trm>0])
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##    5.00   22.00   27.00   30.27   37.50   73.00      67

Duration of illness (continuous [years], v1_dur_illness)

This is a newly created variable by subtracting age at first inpatient treatment from age at first visit (unit is years). Please note that this assumes that the patient was hospitalized for the diagnosis given in here and may therefore not be entirely accurate. In control individuals this was set to -999.

v1_dur_illness_clin<-v1_age[v1_stat=="CLINICAL"]-v1_age_1st_inpat_trm[v1_stat=="CLINICAL"]
table(v1_dur_illness_clin)
## v1_dur_illness_clin
##  -1   0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15  16 
##   8 103  69  55  51  41  50  36  43  45  44  43  52  37  47  33  32  41 
##  17  18  19  20  21  22  23  24  25  26  27  28  29  30  31  32  33  34 
##  24  17  20  21  19  26  13  14  16  12  21  13  17   8  14   7   5   9 
##  35  36  37  38  39  40  41  42  43  44  45  46  47  50  51  52  53 
##   4   5   4   4   5   9   1   4   3   2   2   1   2   1   1   1   1
#Set negative values to NA
v1_dur_illness_clin[v1_dur_illness_clin<0]<-NA 
table(v1_dur_illness_clin)
## v1_dur_illness_clin
##   0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15  16  17 
## 103  69  55  51  41  50  36  43  45  44  43  52  37  47  33  32  41  24 
##  18  19  20  21  22  23  24  25  26  27  28  29  30  31  32  33  34  35 
##  17  20  21  19  26  13  14  16  12  21  13  17   8  14   7   5   9   4 
##  36  37  38  39  40  41  42  43  44  45  46  47  50  51  52  53 
##   5   4   4   5   9   1   4   3   2   2   1   2   1   1   1   1
#Set controls to -999
v1_dur_illness_con<-rep(-999,dim(v1_con)[1])

v1_dur_illness<-c(v1_dur_illness_clin,v1_dur_illness_con)
table(v1_dur_illness)
## v1_dur_illness
## -999    0    1    2    3    4    5    6    7    8    9   10   11   12   13 
##  320  103   69   55   51   41   50   36   43   45   44   43   52   37   47 
##   14   15   16   17   18   19   20   21   22   23   24   25   26   27   28 
##   33   32   41   24   17   20   21   19   26   13   14   16   12   21   13 
##   29   30   31   32   33   34   35   36   37   38   39   40   41   42   43 
##   17    8   14    7    5    9    4    5    4    4    5    9    1    4    3 
##   44   45   46   47   50   51   52   53 
##    2    2    1    2    1    1    1    1

First-episode patient (only in clinical participants) (dichotomous, v1_1st_ep)

This is a newly created variable. Clinical participants with duration of illness of zero years are labeled as first-episode. Control participants have “-999”.

v1_1st_ep_con<-rep(-999,dim(v1_con)[1])
v1_1st_ep_clin<-ifelse(v1_dur_illness_clin==0,"Y","N")

v1_1st_ep<-factor(c(v1_1st_ep_clin,v1_1st_ep_con))
descT(v1_1st_ep)
##                -999 N    Y   <NA>     
## [1,] No. cases 320  1045 103 75   1543
## [2,] Percent   20.7 67.7 6.7 4.9  100

Times treated as day- or inpatient (continuous [times], v1_tms_daypat_outpat_trm)

Interviewers were instructed to use the lowest number if information is imprecise and to use “99” if too many treatments occurred. If the participant is currently treated as in- or daypatient, the number given contains this treatment.

v1_clin_tms_daypat_outpat_trm<-v1_clin$v1_psy_vorg_akt_pva6_anz_psy_behand
v1_con_tms_daypat_outpat_trm<-v1_con$v1_psyaktuel_anzahl

v1_tms_daypat_outpat_trm<-c(v1_clin_tms_daypat_outpat_trm,v1_con_tms_daypat_outpat_trm)
summary(v1_tms_daypat_outpat_trm)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##     0.0     2.0     4.0     6.4     7.0    99.0     392

Times treated as day- or inpatient (ordinal [1,2,3,4], v1_cat_daypat_outpat_trm)

We have decided to transform this variable into an ordinal variable using the following gradings: “smaller or equal five times”-1, “six to ten times”-2, “eleven to fourteen times”-3, “fifteen or more times”-4.

v1_clin_cat_daypat_outpat_trm<-rep(NA,dim(v1_clin)[1])
v1_con_cat_daypat_outpat_trm<-rep(NA,dim(v1_con)[1])

v1_clin_cat_daypat_outpat_trm<-ifelse(v1_clin_tms_daypat_outpat_trm<=5,"1",v1_clin_cat_daypat_outpat_trm)
v1_clin_cat_daypat_outpat_trm<-ifelse(v1_clin_tms_daypat_outpat_trm %in% c(6:10),"2",v1_clin_cat_daypat_outpat_trm)
v1_clin_cat_daypat_outpat_trm<-ifelse(v1_clin_tms_daypat_outpat_trm %in% c(11:13),"3",v1_clin_cat_daypat_outpat_trm)
v1_clin_cat_daypat_outpat_trm<-ifelse(v1_clin_tms_daypat_outpat_trm>=15,"4",v1_clin_cat_daypat_outpat_trm)

v1_con_cat_daypat_outpat_trm<-ifelse(v1_con_tms_daypat_outpat_trm<=5,"1",v1_con_cat_daypat_outpat_trm)
v1_con_cat_daypat_outpat_trm<-ifelse(v1_con_tms_daypat_outpat_trm %in% c(6:10),"2",v1_con_cat_daypat_outpat_trm)
v1_con_cat_daypat_outpat_trm<-ifelse(v1_con_tms_daypat_outpat_trm %in% c(11:13),"3",v1_con_cat_daypat_outpat_trm)
v1_con_cat_daypat_outpat_trm<-ifelse(v1_con_tms_daypat_outpat_trm>=15,"4",v1_con_cat_daypat_outpat_trm)

v1_cat_daypat_outpat_trm<-factor(c(v1_clin_cat_daypat_outpat_trm,v1_con_cat_daypat_outpat_trm),ordered=T)
descT(v1_cat_daypat_outpat_trm)
##                1    2    3   4   <NA>     
## [1,] No. cases 766  257  37  82  401  1543
## [2,] Percent   49.6 16.7 2.4 5.3 26   100

Create dataset

v1_psy_trtmt<-data.frame(v1_cur_psy_trm,v1_outpat_psy_trm,v1_age_1st_out_trm,v1_daypat_inpat_trm,v1_age_1st_inpat_trm,
                        v1_dur_illness,v1_1st_ep,v1_tms_daypat_outpat_trm,v1_cat_daypat_outpat_trm)

Visit 1: Medication

PsyCourse 3.1 now contains medication data. The code below creates the following variables for each person:

Number of antidepressants prescribed (continuous [number], v1_Antidepressants) Number of antipsychotics prescribed (continuous [number], v1_Antipsychotics) Number of mood stabilizers prescribed (continuous [number], v1_Mood_Stabilizers) Number of tranquilizers prescribed (continuous [number], v1_Tranquilizers) Number of other psychiatric medications (continuous [number], v1_Other_psychiatric)

Clinical participants

#get the following variables from v1_clin
#1. Medication name     ["_med_medi_1"]
#2. Medication category ["_med_kategorie_1"]
#3. Depot name          ["_depot_medi_2"]
#4. Depot category      ["_depot_kategorie_2"]
#5. Bedarf name         ["_bedarf_medi_1"]
#6. Bedarf category     ["_bedarf_kategorie_1"]

v1_clin_medication_variables_1<-as.data.frame(v1_clin[,grep("mnppsd|_med_medi_1|_med_kategorie_1|_depot_medi_2|_depot_kategorie_2|_bedarf_medi_1|_bedarf_kategorie_1",names(v1_clin))])
dim(v1_clin_medication_variables_1) #[1] 1223   61
## [1] 1223   61
#recode the variables that are coded as characters/logicals in the "v1_clin_medication_variables_1" as factors
v1_clin_medication_variables_1$v1_medikabehand3_med_medi_199998_17<-as.factor(v1_clin_medication_variables_1$v1_medikabehand3_med_medi_199998_17)

v1_clin_medication_variables_1$v1_medikabehand3_med_kategorie_199998_17<-as.factor(v1_clin_medication_variables_1$v1_medikabehand3_med_kategorie_199998_17)

v1_clin_medication_variables_1$v1_medikabehand3_bedarf_medi_199584_10<-as.factor(v1_clin_medication_variables_1$v1_medikabehand3_bedarf_medi_199584_10)

v1_clin_medication_variables_1$v1_medikabehand3_bedarf_kategorie_199584_10<-as.factor(v1_clin_medication_variables_1$v1_medikabehand3_bedarf_kategorie_199584_10)

#make the duplicated data frame
v1_clin_medications_duplicated_1<-as.data.frame(t(apply(v1_clin_medication_variables_1[,!c(TRUE,FALSE)], 1, duplicated)))
dim(v1_clin_medications_duplicated_1) 
## [1] 1223   30
#recode all duplicated variables, i.e. overlay "_medication_variables_" and "_medications_duplicated_". 
#Important: quotes from "NA" are removed, because variable are coded as facors in v1_clin, not as character 
v1_clin_medication_variables_1[,!c(TRUE, FALSE)][v1_clin_medications_duplicated_1=="TRUE"] <- NA
dim(v1_clin_medication_variables_1) 
## [1] 1223   61
#bind columns id and medication names, but not categories together 
v1_clin_medication_name_1<-as.data.frame(cbind("mnppsd"=v1_clin_medication_variables_1[,1], v1_clin_medication_variables_1[,!c(TRUE, FALSE)]))
dim(v1_clin_medication_name_1) 
## [1] 1223   31
#get the medication categories from the "_medication_variables_1" dataframe
v1_clin_medication_categories_1<-as.data.frame(v1_clin_medication_variables_1[,c(TRUE, FALSE)])
dim(v1_clin_medication_categories_1) 
## [1] 1223   31
#recode all duplicated variables, i.e. overlay "_medication_categories_" and "_medication_name_"
#Important: quotes from "NA" are removed, because variable are coded as facors in v1_clin, not as character 
#Important: v1_clin_medication_name_1=="NA" replaced with is.na(v1_clin_medication_name_1)
v1_clin_medication_categories_1[is.na(v1_clin_medication_name_1)] <- NA
#write.csv(v1_clin_medication_categories_1, file="v1_clin_medication_group_1.csv") 

#Make a count table of medications
v1_clin_med_table<-data.frame("mnppsd"=v1_clin$mnppsd)
v1_clin_med_table$v1_Antidepressants<-rowSums(v1_clin_medication_categories_1 == "Antidepressiva", na.rm = TRUE)
v1_clin_med_table$v1_Antipsychotics<-rowSums(v1_clin_medication_categories_1 == "Antipsychotika", na.rm = TRUE)
v1_clin_med_table$v1_Mood_stabilizers<-rowSums(v1_clin_medication_categories_1 == "Phasenprophylaktika", na.rm = TRUE)
v1_clin_med_table$v1_Tranquilizers<-rowSums(v1_clin_medication_categories_1 == "Sedativa", na.rm = TRUE)
v1_clin_med_table$v1_Other_psychiatric<-rowSums(v1_clin_medication_categories_1 == "Psychopharmaka nicht zuordenbar", na.rm = TRUE)

Control participants

#get the following variables from v1_con
#1. Medication name     ["_med_medi_2"]
#2. Medication category ["_med_kategorie_2"]
#3. Depot name          ["_depot_medi_2"]
#4. Depot category      ["_depot_kategorie_2"]
#5. Bedarf name         ["_bedarf_medi_2"]
#6. Bedarf category     ["_bedarf_kategorie_2"]

v1_con_medication_variables_1<-as.data.frame(v1_con[,grep("mnppsd|_med_medi_2|_med_kategorie_2|_depot_medi_2|_depot_kategorie_2|_bedarf_medi_2|_bedarf_kategorie_2",names(v1_con))])
dim(v1_con_medication_variables_1) 
## [1] 320  29
#recode the variables that are coded as characters/logicals in the "v1_con_medication_variables_1" as factors
v1_con_medication_variables_1$v1_medikabehand3_depot_medi_201224_2<-as.factor(v1_con_medication_variables_1$v1_medikabehand3_depot_medi_201224_2)

v1_con_medication_variables_1$v1_medikabehand3_depot_kategorie_201224_2<-as.factor(v1_con_medication_variables_1$v1_medikabehand3_depot_kategorie_201224_2)

v1_con_medication_variables_1$v1_medikabehand3_bedarf_medi_201187_4<-as.factor(v1_con_medication_variables_1$v1_medikabehand3_bedarf_medi_201187_4)

v1_con_medication_variables_1$v1_medikabehand3_bedarf_kategorie_201187_4<-as.factor(v1_con_medication_variables_1$v1_medikabehand3_bedarf_kategorie_201187_4)

#make the duplicated data frame
v1_con_medications_duplicated_1<-as.data.frame(t(apply(v1_con_medication_variables_1[,!c(TRUE,FALSE)], 1, duplicated)))
dim(v1_con_medications_duplicated_1) #320  14
## [1] 320  14
#recode all duplicated variables, i.e. overlay "_medication_variables_" and "_medications_duplicated_". 
#Important: quotes from "NA" are removed, because variable are coded as facors in v1_con, not as character 
v1_con_medication_variables_1[,!c(TRUE, FALSE)][v1_con_medications_duplicated_1=="TRUE"] <- NA
dim(v1_con_medication_variables_1) #320   29
## [1] 320  29
#bind columns id and medication names, but not categories together 
v1_con_medication_name_1<-as.data.frame(cbind("mnppsd"=v1_con_medication_variables_1[,1], v1_con_medication_variables_1[,!c(TRUE, FALSE)]))
dim(v1_con_medication_name_1) #320  15
## [1] 320  15
#get the medication categories from the "_medication_variables_1" dataframe
v1_con_medication_categories_1<-as.data.frame(v1_con_medication_variables_1[,c(TRUE, FALSE)])
dim(v1_con_medication_categories_1) #320  15
## [1] 320  15
#recode all duplicated variables, i.e. overlay "_medication_categories_" and "_medication_name_"
#Important: quotes from "NA" are removed, because variable are coded as facors in v1_con, not as character
#Important: v1_con_medication_name_1=="NA" replaced with is.na(v1_con_medication_name_1)
v1_con_medication_categories_1[is.na(v1_con_medication_name_1)] <- NA
#write.csv(v1_con_medication_categories_1, file="v1_con_medication_group_1.csv")

#Make a count table of medications
v1_con_med_table<-data.frame("mnppsd"=v1_con$mnppsd)
v1_con_med_table$v1_Antidepressants<-rowSums(v1_con_medication_categories_1 == "Antidepressiva", na.rm = TRUE)
v1_con_med_table$v1_Antipsychotics<-rowSums(v1_con_medication_categories_1 == "Antipsychotika", na.rm = TRUE)
v1_con_med_table$v1_Mood_stabilizers<-rowSums(v1_con_medication_categories_1 == "Phasenprophylaktika", na.rm = TRUE)
v1_con_med_table$v1_Tranquilizers<-rowSums(v1_con_medication_categories_1 == "Sedativa", na.rm = TRUE)
v1_con_med_table$v1_Other_psychiatric<-rowSums(v1_con_medication_categories_1 == "Psychopharmaka nicht zuordenbar", na.rm = TRUE)

Bind v1_clin and v1_con together by rows

v1_drugs<-rbind(v1_clin_med_table,v1_con_med_table)
dim(v1_drugs) #1543    6
## [1] 1543    6
#check if the id column of v1_drugs and v1_id match
table(droplevels(v1_drugs[,1])==v1_id)
## 
## TRUE 
## 1543

Adverse events under current medication (only in clinical participants) (dichotomous, v1_adv)

In control participants, this item is coded “-999”, as it was not assessed.

v1_clin_adv<-ifelse(v1_clin$v1_medikabehand_medi2_nebenwirk==1,"Y","N")
v1_con_adv<-rep("-999",dim(v1_con)[1])
v1_adv<-factor(c(v1_clin_adv,v1_con_adv))
descT(v1_adv)
##                -999 N    Y    <NA>     
## [1,] No. cases 320  302  553  368  1543
## [2,] Percent   20.7 19.6 35.8 23.8 100

Psychiatric medication change during the past six months (dichotomous, v1_medchange)

In control participants, this item is coded “-999”, as it was not assessed.

v1_clin_medchange<-rep(NA,dim(v1_clin)[1])
v1_clin_medchange<-ifelse(v1_clin$v1_medikabehand_medi3_mediaenderung==1,"Y","N")
v1_con_medchange<-rep("-999",dim(v1_con)[1])

v1_medchange<-as.factor(c(v1_clin_medchange,v1_con_medchange))
descT(v1_medchange)
##                -999 N    Y    <NA>     
## [1,] No. cases 320  254  592  377  1543
## [2,] Percent   20.7 16.5 38.4 24.4 100

Lithium

The following two items on medication with lithium are asked in all study vists, in order not to miss participants eligible for the ALDA scale, which is assessed at the last study visit.

“Did you ever take lithium?” (dichotomous, v1_lith)

v1_clin_lith<-rep(NA,dim(v1_clin)[1])
v1_clin_lith<-ifelse(v1_clin$v1_medikabehand_med_zusatz_lithium==1,"Y","N")
v1_con_lith<-rep("-999",dim(v1_con)[1])

v1_lith<-as.factor(c(v1_clin_lith,v1_con_lith))
v1_lith<-as.factor(v1_lith)

descT(v1_lith)
##                -999 N    Y    <NA>     
## [1,] No. cases 320  529  246  448  1543
## [2,] Percent   20.7 34.3 15.9 29   100

“If yes, for how long?” (ordinal [1,2,3], v1_lith_prd)

Ordinal variable, gradation the following: “less than one year”-1, “one to two years”-2, “two or more years”-3. Clinical paricipants not treated with lithium or control participants have “-999” here.

v1_clin_lith_prd<-rep(NA,dim(v1_clin)[1])
v1_con_lith_prd<-rep(-999,dim(v1_con)[1])

v1_clin_lith_prd<-ifelse(v1_clin_lith=="N", -999, ifelse(v1_clin$v1_medikabehand_med_zusatz_dauer==2,1,
                  ifelse(v1_clin$v1_medikabehand_med_zusatz_dauer==1,2,    
                  ifelse(v1_clin$v1_medikabehand_med_zusatz_dauer==0,3,NA))))
                                                     
v1_lith_prd<-factor(c(v1_clin_lith_prd,v1_con_lith_prd))
descT(v1_lith_prd)
##                -999 1   2   3   <NA>     
## [1,] No. cases 849  103 26  117 448  1543
## [2,] Percent   55   6.7 1.7 7.6 29   100

Create dataset

v1_med<-data.frame(v1_drugs[,2:6],v1_adv,v1_medchange,v1_lith,v1_lith_prd)

Visit 1: Family history of psychiatric illness

Family member ever affected by psychiatric disorder (dichotomous, v1_fam_hist)

The option “Participant does not know” is coded as “NA”. The option “Participant does not want to disclose information” is coded as “-999”.

v1_clin_fam_hist<-rep(NA,dim(v1_clin)[1])
v1_con_fam_hist<-rep(NA,dim(v1_con)[1])

v1_clin_fam_hist<-ifelse(v1_clin$v1_psy_famanam_pfa_angeh_pe==0,"N",
                    ifelse(v1_clin$v1_psy_famanam_pfa_angeh_pe==1,"Y",
                    ifelse(v1_clin$v1_psy_famanam_pfa_angeh_pe==2,"-999",
                    ifelse(v1_clin$v1_psy_famanam_pfa_angeh_pe==3,NA,v1_clin_fam_hist)))) 

v1_con_fam_hist<-ifelse(v1_con$v1_famanam_psyangeh==0,"N",
                    ifelse(v1_con$v1_famanam_psyangeh==1,"Y",
                    ifelse(v1_con$v1_famanam_psyangeh==2,"-999",
                    ifelse(v1_con$v1_famanam_psyangeh==3,NA,v1_con_fam_hist))))                     


v1_fam_hist<-as.factor(c(v1_clin_fam_hist,v1_con_fam_hist))
descT(v1_fam_hist)
##                -999 N    Y    <NA>     
## [1,] No. cases 10   436  1034 63   1543
## [2,] Percent   0.6  28.3 67   4.1  100

Also, in the original assessment of psychiatric history, each affected family member is listed, together with an indication whther the diagnosis is certain or not. This detailed information is available on request.

Visit 1: Physical measures and somatic diseases

The method of assessment of physical measures and somatic diseases changed during the course of the study. Selected diseases are now assessed specifically as dichotomous items. Before, it was only assessed whether a participant was ever affected by a group of diseases. If possble, these different phenotypes were harmonized. More detailed information on specific diseases (e.g. “Which type of cancer?”) may be available.

IMPORTANT:

Height (continuous [centimeters], v1_height)

v1_clin_height<-ifelse(is.na(v1_clin$v1_medwkeii_groesse),v1_clin$v1_mwke_mw1_groesse,v1_clin$v1_medwkeii_groesse)
v1_con_height<-ifelse(is.na(v1_con$v1_mwke_groesse),v1_con$v1_medwkeii_groesse,v1_con$v1_mwke_groesse)

v1_height<-c(v1_clin_height,v1_con_height)
summary(v1_height)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   114.0   167.0   174.0   173.7   180.0   203.0      15

Weight (continuous [kilograms], v1_weight)

v1_clin_weight<-ifelse(is.na(v1_clin$v1_medwkeii_gewicht),v1_clin$v1_mwke_mw2_gewicht,v1_clin$v1_medwkeii_gewicht)
v1_con_weight<-ifelse(is.na(v1_con$v1_medwkeii_gewicht),v1_con$v1_mwke_gewicht,v1_con$v1_medwkeii_gewicht)

v1_weight<-c(v1_clin_weight,v1_con_weight)
summary(v1_weight)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   45.00   69.00   80.00   82.95   94.00  190.00      23

Waist circumference (continouos [centimeters], v1_waist) This item was only recorded in a subset of individuals, because the question was introduced while the study was running.

v1_clin_waist<-v1_clin$v1_medwkeii_mw1_taillenumfang
v1_con_waist<-v1_con$v1_medwkeii_mw1_taillenumfang

v1_waist<-c(v1_clin_waist,v1_con_waist)
summary(v1_waist)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   61.00   76.00   86.00   89.01  100.00  149.00    1127

Body mass index (BMI, continuous [BMI], v1_bmi) We here provide the body mass index of study participants, calculated as weight in kilograms divided by the squared height in meters.

v1_bmi<-round(v1_weight/(v1_height/100)^2,2)
summary(v1_bmi)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   16.18   23.05   26.22   27.41   30.41   75.41      23

Elevated cholesterol or triglyceride levels (dichotomous,v1_chol_trig) Phenotype was harmonized with the previous system.

v1_clin_chol_trig<-ifelse(v1_clin$v1_mwke_ke2_an090_stoffw==2,"N", 
                   ifelse(v1_clin$v1_mwke_ke2_an090_stoffw==1 & 
      grepl("[Tt]riglyceride|[Cc]holesterin|[Hh]ypercholesterin|[Hh]ypertriglycerid|Hyperlipoproteinämie|Hypercholestrinomie",
      v1_clin$v1_mwke_ke2_an090_stoffw_det),"Y","N"))

v1_clin_chol_trig<-ifelse(is.na(v1_clin_chol_trig) & v1_clin$v1_medwkeii_medwkeii_ecot==1,"Y",
                   ifelse(is.na(v1_clin_chol_trig) & v1_clin$v1_medwkeii_medwkeii_ecot==2,"N",v1_clin_chol_trig))
 
v1_con_chol_trig<-ifelse(v1_con$v1_mwke_stoffw==2,"N", 
                  ifelse(v1_con$v1_mwke_stoffw==1 & 
      grepl("[Tt]riglyceride|[Cc]holesterin|[Hh]ypercholesterin|[Hh]ypertriglycerid|Hyperlipoproteinämie|Hypercholestrinomie",
      v1_con$v1_mwke_stoffw_t),"Y","N"))

v1_con_chol_trig<-ifelse(is.na(v1_con_chol_trig) & v1_con$v1_medwkeii_medwkeii_ecot==1,"Y",
                   ifelse(is.na(v1_con_chol_trig) & v1_con$v1_medwkeii_medwkeii_ecot==2,"N",v1_con_chol_trig))

v1_chol_trig<-factor(c(v1_clin_chol_trig,v1_con_chol_trig))
descT(v1_chol_trig)
##                N    Y    <NA>     
## [1,] No. cases 1339 177  27   1543
## [2,] Percent   86.8 11.5 1.7  100

Hypertension (dichotomous, v1_hyperten) Phenotype was harmonized with the previous system.

v1_clin_hyperten<-ifelse(v1_clin$v1_mwke_ke1_an010_hke==2,"N", 
                   ifelse(v1_clin$v1_mwke_ke1_an010_hke==1 & 
      grepl("[Hh]yperton|[Hh]oher Blutdruck|[Bb]luthochdruck",
      v1_clin$v1_mwke_ke1_an010_hke_det),"Y","N"))

v1_clin_hyperten<-ifelse(is.na(v1_clin_hyperten) & v1_clin$v1_medwkeii_medwkeii_hyperton==1,"Y",
                   ifelse(is.na(v1_clin_hyperten) & v1_clin$v1_medwkeii_medwkeii_hyperton==2,"N",v1_clin_hyperten))
 
v1_con_hyperten<-ifelse(v1_con$v1_mwke_hke==2,"N", 
                  ifelse(v1_con$v1_mwke_hke==1 & 
      grepl("[Hh]yperton|[Hh]oher Blutdruck|[Bb]luthochdruck",
      v1_con$v1_mwke_hke_t),"Y","N"))

v1_con_hyperten<-ifelse(is.na(v1_con_hyperten) & v1_con$v1_medwkeii_medwkeii_hyperton==1,"Y",
                   ifelse(is.na(v1_con_hyperten) & v1_con$v1_medwkeii_medwkeii_hyperton==2,"N",v1_con_hyperten))

v1_hyperten<-factor(c(v1_clin_hyperten,v1_con_hyperten))
descT(v1_hyperten)
##                N    Y    <NA>     
## [1,] No. cases 1255 264  24   1543
## [2,] Percent   81.3 17.1 1.6  100

Angina pectoris (dichotomous, v1_ang_pec) Phenotype was harmonized with the previous system.

v1_clin_ang_pec<-ifelse(v1_clin$v1_mwke_ke1_an010_hke==2,"N", 
                   ifelse(v1_clin$v1_mwke_ke1_an010_hke==1 & grepl("[Aa]ngina [Pp]ectoris",v1_clin$v1_mwke_ke1_an010_hke_det),"Y","N"))

v1_clin_ang_pec<-ifelse(is.na(v1_clin_ang_pec) & v1_clin$v1_medwkeii_medwkeii_angpec==1,"Y",
                   ifelse(is.na(v1_clin_ang_pec) & v1_clin$v1_medwkeii_medwkeii_angpec==2,"N",v1_clin_ang_pec))
 
v1_con_ang_pec<-ifelse(v1_con$v1_mwke_hke==2,"N", 
                  ifelse(v1_con$v1_mwke_hke==1 & grepl("[Aa]ngina [Pp]ectoris",v1_con$v1_mwke_hke_t),"Y","N"))

v1_con_ang_pec<-ifelse(is.na(v1_con_ang_pec) & v1_con$v1_medwkeii_medwkeii_angpec==1,"Y",
                   ifelse(is.na(v1_con_ang_pec) & v1_con$v1_medwkeii_medwkeii_angpec==2,"N",v1_con_ang_pec))

v1_ang_pec<-factor(c(v1_clin_ang_pec,v1_con_ang_pec))
descT(v1_ang_pec)
##                N    Y  <NA>     
## [1,] No. cases 1503 16 24   1543
## [2,] Percent   97.4 1  1.6  100

Heart attack (dichotomous, v1_heart_att) Phenotype was harmonized with the previous system.

v1_clin_heart_att<-ifelse(v1_clin$v1_mwke_ke1_an010_hke==2,"N", 
                   ifelse(v1_clin$v1_mwke_ke1_an010_hke==1 & grepl("[Hh]erzinfarkt|[Mm]yokardinfarkt",v1_clin$v1_mwke_ke1_an010_hke_det),"Y","N"))

v1_clin_heart_att<-ifelse(is.na(v1_clin_heart_att) & v1_clin$v1_medwkeii_medwkeii_herzinf==1,"Y",
                   ifelse(is.na(v1_clin_heart_att) & v1_clin$v1_medwkeii_medwkeii_herzinf==2,"N",v1_clin_heart_att))
 
v1_con_heart_att<-ifelse(v1_con$v1_mwke_hke==2,"N", 
                  ifelse(v1_con$v1_mwke_hke==1 & grepl("[Hh]erzinfarkt|[Mm]yokardinfarkt",v1_con$v1_mwke_hke_t),"Y","N"))

v1_con_heart_att<-ifelse(is.na(v1_con_heart_att) & v1_con$v1_medwkeii_medwkeii_herzinf==1,"Y",
                   ifelse(is.na(v1_con_heart_att) & v1_con$v1_medwkeii_medwkeii_herzinf==2,"N",v1_con_heart_att))

v1_heart_att<-factor(c(v1_clin_heart_att,v1_con_heart_att))
descT(v1_heart_att)
##                N    Y  <NA>     
## [1,] No. cases 1502 15 26   1543
## [2,] Percent   97.3 1  1.7  100

Stroke (dichotomous, v1_stroke) Phenotype was harmonized with the previous system.

v1_clin_stroke<-ifelse(v1_clin$v1_mwke_ke1_an010_hke==2,"N", 
                   ifelse(v1_clin$v1_mwke_ke1_an010_hke==1 & grepl("[Ss]chlaganfall|[Hh]irnblutung|[Gg]ehirnblutung",v1_clin$v1_mwke_ke1_an010_hke_det),"Y","N"))

v1_clin_stroke<-ifelse(is.na(v1_clin_stroke) & v1_clin$v1_medwkeii_medwkeii_schlag==1,"Y",
                   ifelse(is.na(v1_clin_stroke) & v1_clin$v1_medwkeii_medwkeii_schlag==2,"N",v1_clin_stroke))
 
v1_con_stroke<-ifelse(v1_con$v1_mwke_hke==2,"N", 
                  ifelse(v1_con$v1_mwke_hke==1 & grepl("[Ss]chlaganfall|[Hh]irnblutung|[Gg]ehirnblutung",v1_con$v1_mwke_hke_t),"Y","N"))

v1_con_stroke<-ifelse(is.na(v1_con_stroke) & v1_con$v1_medwkeii_medwkeii_schlag==1,"Y",
                   ifelse(is.na(v1_con_stroke) & v1_con$v1_medwkeii_medwkeii_schlag==2,"N",v1_con_stroke))

v1_stroke<-factor(c(v1_clin_stroke,v1_con_stroke))
descT(v1_stroke)
##                N    Y   <NA>     
## [1,] No. cases 1507 11  25   1543
## [2,] Percent   97.7 0.7 1.6  100

Diabetes (dichotomous, v1_diabetes) Phenotype was harmonized with the previous system.

v1_clin_diabetes<-ifelse(v1_clin$v1_mwke_ke2_an090_stoffw==2,"N", 
                   ifelse(v1_clin$v1_mwke_ke2_an090_stoffw==1 & 
      grepl("[Dd]iabetes|[Zz]ucker",v1_clin$v1_mwke_ke2_an090_stoffw_det),"Y","N"))

v1_clin_diabetes<-ifelse(is.na(v1_clin_diabetes) & v1_clin$v1_medwkeii_medwkeii_zuck==1,"Y",
                   ifelse(is.na(v1_clin_diabetes) & v1_clin$v1_medwkeii_medwkeii_zuck==2,"N",v1_clin_diabetes))
 
v1_con_diabetes<-ifelse(v1_con$v1_mwke_stoffw==2,"N", 
                  ifelse(v1_con$v1_mwke_stoffw==1 & grepl("[Dd]iabetes|[Zz]ucker",v1_con$v1_mwke_stoffw_t),"Y","N"))

v1_con_diabetes<-ifelse(is.na(v1_con_diabetes) & v1_con$v1_medwkeii_medwkeii_zuck==1,"Y",
                   ifelse(is.na(v1_con_diabetes) & v1_con$v1_medwkeii_medwkeii_zuck==2,"N",v1_con_diabetes))

v1_diabetes<-factor(c(v1_clin_diabetes,v1_con_diabetes))
descT(v1_diabetes)
##                N    Y   <NA>     
## [1,] No. cases 1408 108 27   1543
## [2,] Percent   91.3 7   1.7  100

Hyperthyroidism (dichotomous, v1_hyperthy) Phenotype was harmonized with the previous system.

v1_clin_hyperthy<-ifelse(v1_clin$v1_mwke_ke3_an11_schildd==2,"N", 
                   ifelse(v1_clin$v1_mwke_ke3_an11_schildd==1 & 
    grepl("[Üü]berfunktion|[Uu]eberfunktion|[Ss]childdrüsenüberfunktion|[Hh]yperthyreose",v1_clin$v1_mwke_ke3_an11_schildd_det),"Y","N"))

v1_clin_hyperthy<-ifelse(is.na(v1_clin_hyperthy) & v1_clin$v1_medwkeii_medwkeii_hypothy==1,"Y",
                   ifelse(is.na(v1_clin_hyperthy) & v1_clin$v1_medwkeii_medwkeii_hypothy==2,"N",v1_clin_hyperthy))
 
v1_con_hyperthy<-ifelse(v1_con$v1_mwke_schildd==2,"N", 
                  ifelse(v1_con$v1_mwke_schildd==1 & 
   grepl("[Üü]berfunktion|[Uu]eberfunktion|[Ss]childdrüsenüberfunktion|[Hh]yperthyreose",v1_con$v1_mwke_schildd_t),"Y","N"))

v1_con_hyperthy<-ifelse(is.na(v1_con_hyperthy) & v1_con$v1_medwkeii_medwkeii_hypothy==1,"Y",
                   ifelse(is.na(v1_con_hyperthy) & v1_con$v1_medwkeii_medwkeii_hypothy==2,"N",v1_con_hyperthy))

v1_hyperthy<-factor(c(v1_clin_hyperthy,v1_con_hyperthy))
descT(v1_hyperthy)
##                N    Y   <NA>     
## [1,] No. cases 1402 111 30   1543
## [2,] Percent   90.9 7.2 1.9  100

Hypothyroidism (dichotomous, v1_hypothy) Phenotype was harmonized with the previous system.

v1_clin_hypothy<-ifelse(v1_clin$v1_mwke_ke3_an11_schildd==2,"N", 
                   ifelse(v1_clin$v1_mwke_ke3_an11_schildd==1 & 
grepl("[Uu]nterfunktion|[Ss]childdrüsenunterfunktion|Hashimoto|[Hh]ypothyreose|[Tt]hyreoiditis|[Ee]ntfernt",v1_clin$v1_mwke_ke3_an11_schildd_det),"Y","N"))

v1_clin_hypothy<-ifelse(is.na(v1_clin_hypothy) & v1_clin$v1_medwkeii_medwkeii_hypothy==1,"Y",
                   ifelse(is.na(v1_clin_hypothy) & v1_clin$v1_medwkeii_medwkeii_hypothy==2,"N",v1_clin_hypothy))
 
v1_con_hypothy<-ifelse(v1_con$v1_mwke_schildd==2,"N", 
                  ifelse(v1_con$v1_mwke_schildd==1 & 
   grepl("[Uu]nterfunktion|[Ss]childdrüsenunterfunktion|Hashimoto|[Hh]ypothyreose|[Tt]hyreoiditis|[Ee]ntfernt",v1_con$v1_mwke_schildd_t),"Y","N"))

v1_con_hypothy<-ifelse(is.na(v1_con_hypothy) & v1_con$v1_medwkeii_medwkeii_hypothy==1,"Y",
                   ifelse(is.na(v1_con_hypothy) & v1_con$v1_medwkeii_medwkeii_hypothy==2,"N",v1_con_hypothy))

v1_hypothy<-factor(c(v1_clin_hypothy,v1_con_hypothy))
descT(v1_hypothy)
##                N    Y    <NA>     
## [1,] No. cases 1260 253  30   1543
## [2,] Percent   81.7 16.4 1.9  100

Osteoporosis (dichotomous, v1_osteopor) Phenotype was harmonized with the previous system.

v1_clin_osteopor<-ifelse(v1_clin$v1_mwke_ke4_an130_rme==2,"N", 
                   ifelse(v1_clin$v1_mwke_ke4_an130_rme==1 & 
grepl("[Oo]steoporose|[Kk]nochenschwund",v1_clin$v1_mwke_ke4_an130_rme_det),"Y","N"))

v1_clin_osteopor<-ifelse(is.na(v1_clin_osteopor) & v1_clin$v1_medwkeii_medwkeii_osterop==1,"Y",
                   ifelse(is.na(v1_clin_osteopor) & v1_clin$v1_medwkeii_medwkeii_osterop==2,"N",v1_clin_osteopor))
 
v1_con_osteopor<-ifelse(v1_con$v1_mwke_rme==2,"N", 
                  ifelse(v1_con$v1_mwke_rme==1 & 
   grepl("[Oo]steoporose|[Kk]nochenschwund",v1_con$v1_mwke_rme_t),"Y","N"))

v1_con_osteopor<-ifelse(is.na(v1_con_osteopor) & v1_con$v1_medwkeii_medwkeii_osterop==1,"Y",
                   ifelse(is.na(v1_con_osteopor) & v1_con$v1_medwkeii_medwkeii_osterop==2,"N",v1_con_osteopor))

v1_osteopor<-factor(c(v1_clin_osteopor,v1_con_osteopor))
descT(v1_osteopor)
##                N    Y   <NA>     
## [1,] No. cases 1489 26  28   1543
## [2,] Percent   96.5 1.7 1.8  100

Asthma (dichotomous, v1_asthma) Phenotype was harmonized with the previous system.

v1_clin_asthma<-ifelse(v1_clin$v1_mwke_ke5_an180_lunge==2,"N", 
                   ifelse(v1_clin$v1_mwke_ke5_an180_lunge==1 & 
grepl("[Aa]sthma",v1_clin$v1_mwke_ke5_an180_lunge_det),"Y","N"))

v1_clin_asthma<-ifelse(is.na(v1_clin_asthma) & v1_clin$v1_medwkeii_medwkeii_asthma==1,"Y",
                   ifelse(is.na(v1_clin_asthma) & v1_clin$v1_medwkeii_medwkeii_asthma==2,"N",v1_clin_asthma))
 
v1_con_asthma<-ifelse(v1_con$v1_mwke_lunge==2,"N", 
                  ifelse(v1_con$v1_mwke_lunge==1 & 
   grepl("[Aa]sthma",v1_con$v1_mwke_lunge_t),"Y","N"))

v1_con_asthma<-ifelse(is.na(v1_con_asthma) & v1_con$v1_medwkeii_medwkeii_asthma==1,"Y",
                   ifelse(is.na(v1_con_asthma) & v1_con$v1_medwkeii_medwkeii_asthma==2,"N",v1_con_asthma))

v1_asthma<-factor(c(v1_clin_asthma,v1_con_asthma))
descT(v1_asthma)
##                N    Y   <NA>     
## [1,] No. cases 1399 120 24   1543
## [2,] Percent   90.7 7.8 1.6  100

COPD/chronic Bronchitis (dichotomous, v1_copd) Phenotype was harmonized with the previous system.

v1_clin_copd<-ifelse(v1_clin$v1_mwke_ke5_an180_lunge==2,"N", 
                   ifelse(v1_clin$v1_mwke_ke5_an180_lunge==1 & 
grepl("COPD|[Cc]hronische Bronchitis|[Cc]hron. Bronchitis|Chronisch obstruktive Atemwegserkrankung",v1_clin$v1_mwke_ke5_an180_lunge_det),"Y","N"))

v1_clin_copd<-ifelse(is.na(v1_clin_copd) & v1_clin$v1_medwkeii_medwkeii_copd==1,"Y",
                   ifelse(is.na(v1_clin_copd) & v1_clin$v1_medwkeii_medwkeii_copd==2,"N",v1_clin_copd))
 
v1_con_copd<-ifelse(v1_con$v1_mwke_lunge==2,"N", 
                  ifelse(v1_con$v1_mwke_lunge==1 & 
   grepl("COPD|[Cc]hronische Bronchitis|[Cc]hron. Bronchitis|Chronisch obstruktive Atemwegserkrankung",v1_con$v1_mwke_lunge_t),"Y","N"))

v1_con_copd<-ifelse(is.na(v1_con_copd) & v1_con$v1_medwkeii_medwkeii_copd==1,"Y",
                   ifelse(is.na(v1_con_copd) & v1_con$v1_medwkeii_medwkeii_copd==2,"N",v1_con_copd))

v1_copd<-factor(c(v1_clin_copd,v1_con_copd))
descT(v1_copd)
##                N    Y   <NA>     
## [1,] No. cases 1451 68  24   1543
## [2,] Percent   94   4.4 1.6  100

Allergies (dichotomus, v1_allerg) Phenotype was harmonized with the previous system.

v1_clin_allerg<-ifelse(v1_clin$v1_mwke_ke6_an200_allerg==1,"Y","N")
v1_clin_allerg<-ifelse(is.na(v1_clin_allerg) & v1_clin$v1_medwkeii_medwkeii_allerg==1,"Y",
                       ifelse(is.na(v1_clin_allerg) & v1_clin$v1_medwkeii_medwkeii_allerg==2,"N",v1_clin_allerg))

v1_con_allerg<-ifelse(v1_con$v1_mwke_allerg==1,"Y","N")
v1_con_allerg<-ifelse(is.na(v1_con_allerg) & v1_con$v1_medwkeii_medwkeii_allerg==1,"Y",
                       ifelse(is.na(v1_con_allerg) & v1_con$v1_medwkeii_medwkeii_allerg==2,"N",v1_con_allerg))

v1_allerg<-factor(c(v1_clin_allerg,v1_con_allerg))
descT(v1_allerg)
##                N    Y   <NA>     
## [1,] No. cases 888  633 22   1543
## [2,] Percent   57.6 41  1.4  100

Neurodermatitis (dichotomous, v1_neuroder) Phenotype was harmonized with the previous system.

v1_clin_neuroder<-ifelse(v1_clin$v1_mwke_ke9_an330_haut==2,"N", 
                   ifelse(v1_clin$v1_mwke_ke9_an330_haut==1 & 
grepl("[Nn]eurodermitis",v1_clin$v1_mwke_ke9_an330_haut_det),"Y","N"))

v1_clin_neuroder<-ifelse(is.na(v1_clin_neuroder) & v1_clin$v1_medwkeii_medwkeii_neurod==1,"Y",
                   ifelse(is.na(v1_clin_neuroder) & v1_clin$v1_medwkeii_medwkeii_neurod==2,"N",v1_clin_neuroder))
 
v1_con_neuroder<-ifelse(v1_con$v1_mwke_haut==2,"N", 
                  ifelse(v1_con$v1_mwke_haut==1 & 
   grepl("[Nn]eurodermitis",v1_con$v1_mwke_haut_t),"Y","N"))

v1_con_neuroder<-ifelse(is.na(v1_con_neuroder) & v1_con$v1_medwkeii_medwkeii_neurod==1,"Y",
                   ifelse(is.na(v1_con_neuroder) & v1_con$v1_medwkeii_medwkeii_neurod==2,"N",v1_con_neuroder))

v1_neuroder<-factor(c(v1_clin_neuroder,v1_con_neuroder))
descT(v1_neuroder)
##                N    Y   <NA>     
## [1,] No. cases 1420 96  27   1543
## [2,] Percent   92   6.2 1.7  100

Psoriasis (dichotomous, v1_psoriasis) Phenotype was harmonized with the previous system.

v1_clin_psoriasis<-ifelse(v1_clin$v1_mwke_ke9_an330_haut==2,"N", 
                   ifelse(v1_clin$v1_mwke_ke9_an330_haut==1 & 
grepl("[Pp]soriasis|[Ss][Cc]huppenflechte",v1_clin$v1_mwke_ke9_an330_haut_det),"Y","N"))

v1_clin_psoriasis<-ifelse(is.na(v1_clin_psoriasis) & v1_clin$v1_medwkeii_medwkeii_neurod==1,"Y",
                   ifelse(is.na(v1_clin_psoriasis) & v1_clin$v1_medwkeii_medwkeii_neurod==2,"N",v1_clin_psoriasis))
 
v1_con_psoriasis<-ifelse(v1_con$v1_mwke_haut==2,"N", 
                  ifelse(v1_con$v1_mwke_haut==1 & 
   grepl("[Ss][Cc]huppenflechte|[Ss][Cc]huppenflechte",v1_con$v1_mwke_haut_t),"Y","N"))

v1_con_psoriasis<-ifelse(is.na(v1_con_psoriasis) & v1_con$v1_medwkeii_medwkeii_neurod==1,"Y",
                   ifelse(is.na(v1_con_psoriasis) & v1_con$v1_medwkeii_medwkeii_neurod==2,"N",v1_con_psoriasis))

v1_psoriasis<-factor(c(v1_clin_psoriasis,v1_con_psoriasis))
descT(v1_psoriasis)
##                N    Y   <NA>     
## [1,] No. cases 1444 72  27   1543
## [2,] Percent   93.6 4.7 1.7  100

Autoimmune diseases (dichotomous, v1_autoimm)

v1_clin_autoimm_yn<-ifelse(v1_clin$v1_medwkeii_medwkeii_autoim==1,"Y","N")
v1_con_autoimm_yn<-ifelse(v1_con$v1_medwkeii_medwkeii_autoim==1,"Y","N")
 
v1_autoimm<-factor(c(v1_clin_autoimm_yn,v1_con_autoimm_yn))
descT(v1_autoimm)
##                N    Y   <NA>     
## [1,] No. cases 466  25  1052 1543
## [2,] Percent   30.2 1.6 68.2 100

Cancer (dichotomous, v1_cancer) Similar question asked in previous system.Information on the type of cancer is available on request.

v1_clin_cancer<-ifelse(v1_clin$v1_mwke_ke14_an56_krebs==1,"Y","N")
v1_clin_cancer<-ifelse(is.na(v1_clin_cancer) & v1_clin$v1_medwkeii_medwkeii_kreberk==1,"Y",
                   ifelse(is.na(v1_clin_cancer) & v1_clin$v1_medwkeii_medwkeii_kreberk==2,"N",v1_clin_cancer))

v1_con_cancer<-ifelse(v1_con$v1_mwke_krebs==1,"Y","N")
v1_con_cancer<-ifelse(is.na(v1_con_cancer) & v1_con$v1_medwkeii_medwkeii_kreberk==1,"Y",
                   ifelse(is.na(v1_con_cancer) & v1_con$v1_medwkeii_medwkeii_kreberk==2,"N",v1_con_cancer))

v1_cancer<-factor(c(v1_clin_cancer,v1_con_cancer))
descT(v1_cancer)
##                N    Y   <NA>     
## [1,] No. cases 1443 75  25   1543
## [2,] Percent   93.5 4.9 1.6  100

Stomach ulcer (dichotomous, v1_stom_ulc) Phenotype was harmonized with the previous system.

v1_clin_stom_ulc<-ifelse(v1_clin$v1_medwkeii_medwkeii_maggesch==1,"Y","N")
v1_clin_stom_ulc<-ifelse(is.na(v1_clin_stom_ulc) & v1_clin$v1_mwke_ke7_an270_mde==2,"N",
                  ifelse(is.na(v1_clin_stom_ulc) & v1_clin$v1_mwke_ke7_an270_mde==1 & 
                      grepl("[Mm]agengeschwür",v1_clin$v1_mwke_ke7_an270_mde_det),"Y",v1_clin_stom_ulc))

v1_con_stom_ulc<-ifelse(v1_con$v1_medwkeii_medwkeii_maggesch==1,"Y","N")
v1_con_stom_ulc<-ifelse(is.na(v1_con_stom_ulc) & v1_con$v1_mwke_mde==2,"N",
                  ifelse(is.na(v1_con_stom_ulc) & v1_con$v1_mwke_mde==1 & 
                      grepl("[Mm]agengeschwür",v1_con$v1_mwke_mde_t),"Y",v1_con_stom_ulc))
  
v1_stom_ulc<-factor(c(v1_clin_stom_ulc,v1_con_stom_ulc))
descT(v1_stom_ulc)
##                N    Y   <NA>     
## [1,] No. cases 1315 29  199  1543
## [2,] Percent   85.2 1.9 12.9 100

Kidney failure (dichotomous, v1_kid_fail)

v1_clin_kid_fail<-ifelse(v1_clin$v1_medwkeii_medwkeii_nierver==1,"Y","N")
v1_clin_kid_fail<-ifelse(is.na(v1_clin_kid_fail) & v1_clin$v1_mwke_ke10_an360_nibl==2,"N",
                  ifelse(is.na(v1_clin_kid_fail) & v1_clin$v1_mwke_ke10_an360_nibl==1 & 
                      grepl("[Nn]ierenversagen",v1_clin$v1_mwke_ke10_an360_nibl_det),"Y",v1_clin_kid_fail))

v1_con_kid_fail<-ifelse(v1_con$v1_medwkeii_medwkeii_nierver==1,"Y","N")
v1_con_kid_fail<-ifelse(is.na(v1_con_kid_fail) & v1_con$v1_mwke_nibl==2,"N",
                  ifelse(is.na(v1_con_kid_fail) & v1_con$v1_mwke_nibl==1 & 
                      grepl("[Nn]ierenversagen",v1_con$v1_mwke_nibl_t),"Y",v1_con_kid_fail))
  
v1_kid_fail<-factor(c(v1_clin_kid_fail,v1_con_kid_fail))
descT(v1_kid_fail)
##                N    Y   <NA>     
## [1,] No. cases 1390 4   149  1543
## [2,] Percent   90.1 0.3 9.7  100

Kidney-/Gallstone (dichotomous, v1_stone)

v1_clin_stone<-ifelse(v1_clin$v1_medwkeii_medwkeii_nierga==1,"Y","N")
v1_clin_stone<-ifelse(is.na(v1_clin_stone) & v1_clin$v1_mwke_ke10_an360_nibl==2,"N",
                  ifelse(is.na(v1_clin_stone) & (v1_clin$v1_mwke_ke10_an360_nibl==1 | v1_clin$v1_mwke_ke8_an300_galleb) & 
                      (grepl("[Nn]ierenstein|[Nn]ierensteine",v1_clin$v1_mwke_ke10_an360_nibl_det) |
                       grepl("[Gg]allenstein|[Gg]allensteine",v1_clin$v1_mwke_ke8_an300_galleb_det)),"Y",v1_clin_stone))

v1_con_stone<-ifelse(v1_con$v1_medwkeii_medwkeii_nierga==1,"Y","N")
v1_con_stone<-ifelse(is.na(v1_con_stone) & v1_con$v1_mwke_nibl==2,"N",
                  ifelse(is.na(v1_con_stone) & (v1_con$v1_mwke_nibl==1 | v1_con$v1_mwke_galle==1) & 
                     (grepl("[Nn]ierenstein|[Nn]ierensteine",v1_con$v1_mwke_nibl_t) |
                       grepl("[Gg]allenstein|[Gg]allensteine",v1_con$v1_mwke_galle_t)),"Y",v1_con_stone))      
                          
v1_stone<-factor(c(v1_clin_stone,v1_con_stone))
descT(v1_stone)
##                N    Y   <NA>     
## [1,] No. cases 1370 43  130  1543
## [2,] Percent   88.8 2.8 8.4  100

Epilepsy (dichotomous, v1_epilepsy)

v1_clin_epilepsy<-ifelse(v1_clin$v1_medwkeii_medwkeii_epile==1,"Y","N")
v1_clin_epilepsy<-ifelse(is.na(v1_clin_epilepsy) & v1_clin$v1_mwke_ke11_an400_npsy==2,"N",
                  ifelse(is.na(v1_clin_epilepsy) & v1_clin$v1_mwke_ke11_an400_npsy==1 & 
                      grepl("[Ee]pilepsie",v1_clin$v1_mwke_ke11_an400_npsy_det),"Y",v1_clin_epilepsy))

v1_con_epilepsy<-ifelse(v1_con$v1_medwkeii_medwkeii_epile==1,"Y","N")
v1_con_epilepsy<-ifelse(is.na(v1_con_epilepsy) & v1_con$v1_mwke_npsy==2,"N",
                  ifelse(is.na(v1_con_epilepsy) & v1_con$v1_mwke_npsy==1 & 
                     grepl("[Ee]pilepsie",v1_con$v1_mwke_npsy_t),"Y",v1_con_epilepsy))      
                          
v1_epilepsy<-factor(c(v1_clin_epilepsy,v1_con_epilepsy))
descT(v1_epilepsy)
##                N    Y   <NA>     
## [1,] No. cases 1266 19  258  1543
## [2,] Percent   82   1.2 16.7 100

Migraine (dichotomous, v1_migraine)

v1_clin_migraine<-ifelse(v1_clin$v1_medwkeii_medwkeii_mig==1,"Y","N")
v1_clin_migraine<-ifelse(is.na(v1_clin_migraine) & v1_clin$v1_mwke_ke11_an400_npsy==2,"N",
                  ifelse(is.na(v1_clin_migraine) & v1_clin$v1_mwke_ke11_an400_npsy==1 & 
                      grepl("[Mm]igräne | Mirgäne | mIGRÄNE",v1_clin$v1_mwke_ke11_an400_npsy_det),"Y",v1_clin_migraine))

v1_con_migraine<-ifelse(v1_con$v1_medwkeii_medwkeii_mig==1,"Y","N")
v1_con_migraine<-ifelse(is.na(v1_con_migraine) & v1_con$v1_mwke_npsy==2,"N",
                  ifelse(is.na(v1_con_migraine) & v1_con$v1_mwke_npsy==1 & 
                     grepl("[Mm]igräne | Mirgäne | mIGRÄNE",v1_con$v1_mwke_npsy_t),"Y",v1_con_migraine))      
                          
v1_migraine<-factor(c(v1_clin_migraine,v1_con_migraine))
descT(v1_migraine)
##                N    Y  <NA>     
## [1,] No. cases 1216 62 265  1543
## [2,] Percent   78.8 4  17.2 100

Parkinson syndrome (dichotomous, v1_parkinson)

v1_clin_parkinson<-ifelse(v1_clin$v1_medwkeii_medwkeii_parks==1,"Y","N")
v1_clin_parkinson<-ifelse(is.na(v1_clin_parkinson) & v1_clin$v1_mwke_ke11_an400_npsy==2,"N",
                  ifelse(is.na(v1_clin_parkinson) & v1_clin$v1_mwke_ke11_an400_npsy==1 & 
                      grepl("[Pp]arkinson",v1_clin$v1_mwke_ke11_an400_npsy_det),"Y",v1_clin_parkinson))

                  
v1_con_parkinson<-ifelse(v1_con$v1_medwkeii_medwkeii_parks==1,"Y","N")
v1_con_parkinson<-ifelse(is.na(v1_con_parkinson) & v1_con$v1_mwke_npsy==2,"N",
                  ifelse(is.na(v1_con_parkinson) & v1_con$v1_mwke_npsy==1 & 
                     grepl("[Pp]arkinson",v1_con$v1_mwke_npsy_t),"Y",v1_con_parkinson))      
                          
v1_parkinson<-factor(c(v1_clin_parkinson,v1_con_parkinson))
descT(v1_parkinson)
##                N    Y   <NA>     
## [1,] No. cases 1269 8   266  1543
## [2,] Percent   82.2 0.5 17.2 100

Liver cirrhosis or inflammation (dichotomous, v1_liv_cir_inf)

v1_clin_liv_cir_inf<-ifelse(v1_clin$v1_medwkeii_medwkeii_leberz==1,"Y","N")
v1_clin_liv_cir_inf<-ifelse(is.na(v1_clin_liv_cir_inf) & v1_clin$v1_mwke_ke8_an300_galleb==2,"N",
                  ifelse(is.na(v1_clin_liv_cir_inf) & v1_clin$v1_mwke_ke8_an300_galleb==1 & 
                      grepl("[Ll]eberzerose | [Ll]eberzirrhose |   
                            [Ll]eberentzündung",v1_clin$v1_mwke_ke8_an300_galleb_det),"Y",v1_clin_liv_cir_inf))

v1_con_liv_cir_inf<-ifelse(v1_con$v1_medwkeii_medwkeii_leberz==1,"Y","N")
v1_con_liv_cir_inf<-ifelse(is.na(v1_con_liv_cir_inf) & v1_con$v1_mwke_galle==2,"N",
                  ifelse(is.na(v1_con_liv_cir_inf) & v1_con$v1_mwke_galle==1 & 
                     grepl("[Ll]eberzerose | [Ll]eberzirrhose |   
                            [Ll]eberentzündung",v1_con$v1_mwke_galle_t),"Y",v1_con_liv_cir_inf))      
                          
v1_liv_cir_inf<-factor(c(v1_clin_liv_cir_inf,v1_con_liv_cir_inf))
descT(v1_liv_cir_inf)
##                N    Y   <NA>     
## [1,] No. cases 1397 4   142  1543
## [2,] Percent   90.5 0.3 9.2  100

Traumatic brain injury (dichotomous, v1_tbi)

v1_clin_tbi<-ifelse(v1_clin$v1_medwkeii_medwkeii_parks==1,"Y","N")
v1_clin_tbi<-ifelse(is.na(v1_clin_tbi) & v1_clin$v1_mwke_ke11_an400_npsy==2,"N",
                  ifelse(is.na(v1_clin_tbi) & v1_clin$v1_mwke_ke11_an400_npsy==1 & 
                      grepl("[Ss]chädel-Hirn-Trauma",v1_clin$v1_mwke_ke11_an400_npsy_det),"Y",v1_clin_tbi))

v1_con_tbi<-ifelse(v1_con$v1_medwkeii_medwkeii_parks==1,"Y","N")
v1_con_tbi<-ifelse(is.na(v1_con_tbi) & v1_con$v1_mwke_npsy==2,"N",
                  ifelse(is.na(v1_con_tbi) & v1_con$v1_mwke_npsy==1 & 
                     grepl("[Ss]chädel-Hirn-Trauma",v1_con$v1_mwke_npsy_t),"Y",v1_con_tbi))      
                          
v1_tbi<-factor(c(v1_clin_tbi,v1_con_tbi))
descT(v1_tbi)
##                N    Y   <NA>     
## [1,] No. cases 1269 4   270  1543
## [2,] Percent   82.2 0.3 17.5 100

Disorders of the eyes or ears (dichotomous, v1_eyear) This item was also asked in the previous method of assessment, with three answering alternatives: “Yes,”No“, and”Don’t know“. The option”Don’t know" was coded as NA, to harmonize it with the new methode of assessment. Near- or farsightedness, according to our guidelines, is not a disease and should not be coded as such. There is more information on the type of disease, available on request.

v1_clin_eyear<-ifelse(v1_clin$v1_mwke_ke12_an440_auohr==1,"Y",ifelse(v1_clin$v1_mwke_ke12_an440_auohr==2,"N",NA))
v1_clin_eyear<-ifelse(is.na(v1_clin_eyear) & v1_clin$v1_medwkeii_medwkeii_auo==1,"Y",
                      ifelse(is.na(v1_clin_eyear) & v1_clin$v1_medwkeii_medwkeii_auo==2,"N",v1_clin_eyear))

v1_con_eyear<-ifelse(v1_con$v1_mwke_auohr==1,"Y",ifelse(v1_con$v1_mwke_auohr==2,"N",NA))
v1_con_eyear<-ifelse(is.na(v1_con_eyear) & v1_con$v1_medwkeii_medwkeii_auo==1,"Y",
                      ifelse(is.na(v1_con_eyear) & v1_con$v1_medwkeii_medwkeii_auo==2,"N",v1_con_eyear))
                        
v1_eyear<-factor(c(v1_clin_eyear,v1_con_eyear))
descT(v1_eyear)
##                N    Y    <NA>     
## [1,] No. cases 1304 208  31   1543
## [2,] Percent   84.5 13.5 2    100

Infectious diseases (dichotomous, v1_inf) As the assessment of this item was modified in the course of the study (at some point interviewers were instructed not to code benign childhood diseases such as chickenpox), this item is NOT included in this version of the dataset anymore. The variable name remains in the codebook, but not in the dataset.

Create dataset

v1_som_dsrdr<-data.frame(v1_height,
                         v1_weight,
                         v1_waist,
                         v1_bmi,
                         v1_chol_trig,
                         v1_hyperten,
                         v1_ang_pec,
                         v1_heart_att,
                         v1_stroke,
                         v1_diabetes,
                         v1_hyperthy,
                         v1_hypothy,
                         v1_osteopor,
                         v1_asthma,
                         v1_copd,
                         v1_allerg,
                         v1_neuroder,
                         v1_psoriasis,
                         v1_autoimm,
                         v1_cancer,
                         v1_stom_ulc,
                         v1_kid_fail,
                         v1_stone,
                         v1_epilepsy,
                         v1_migraine,
                         v1_parkinson,
                         v1_liv_cir_inf,
                         v1_tbi,
                         v1_eyear)

Visit 1: Substance abuse

Tobacco

There is some more information available (whether smokers have stopped smoking more than one year, if yes how many years, how many pipes, cigars and cigarillos), not part of the present dataset.

Did you ever smoke tobacco products? (categorical [Y,N,F], v1_ever_smkd)

This is a categorical item with three optional answers: “never”-N, “yes”-Y, and “former” (having smoked in the past but not now)-F. It is required to have stopped smoking for at least three months to qualify as former smoker.

v1_clin_ever_smkd<-ifelse(v1_clin$v1_tabalk_ta1_jemals_ger==1,"N",
                     ifelse(v1_clin$v1_tabalk_ta1_jemals_ger==2,"Y",
                            ifelse(v1_clin$v1_tabalk_ta1_jemals_ger==3,"F",NA))) 

v1_con_ever_smkd<-ifelse(v1_con$v1_tabalk_tabak1==1,"N",
                     ifelse(v1_con$v1_con$v1_tabalk_tabak1==2,"Y",
                            ifelse(v1_con$v1_tabalk_tabak1==3,"F",NA))) 

v1_ever_smkd<-factor(c(v1_clin_ever_smkd,v1_con_ever_smkd))
descT(v1_ever_smkd)
##                F    N    Y    <NA>     
## [1,] No. cases 208  527  657  151  1543
## [2,] Percent   13.5 34.2 42.6 9.8  100

At what age did you start smoking? (continuous [age], v1_age_smk)

The original item has three optional answers (age unknown, age or alternatively year in which smoking started). Here, we give age at which smoking started. In cases in which the year in which smoking started was given, we calculated this as follows: year in which smoking stated minus (year of interview minus age at interview). For people who never smoked, this question is coded as “-999”.

v1_clin_age_smk<-ifelse(v1_clin$v1_tabalk_ta1_jemals_ger==1, -999, ifelse(is.na(v1_clin$v1_tabalk_ta2_alter_jahre)==T,
          (v1_clin$v1_tabalk_ta2_anf_jahr-(as.numeric(format(v1_interv_date,'%Y'))-v1_clin$v1_ageBL)),v1_clin$v1_tabalk_ta2_alter_jahre))

v1_con_age_smk<-ifelse(v1_con$v1_tabalk_tabak1, -999, ifelse(is.na(v1_con$v1_tabalk_tabak2_alter)==T,
            (v1_con$v1_tabalk_tabak2_jahr-(as.numeric(format(interv_date,'%Y'))-v1_ageBL)),v1_con$v1_tabalk_ta2_alter_jahre))

v1_age_smk<-factor(c(v1_clin_age_smk,v1_con_age_smk))
summary(v1_age_smk)
## -999    5    6    7    8    9   10   11   12   13   14   15   16   17   18 
##  662    2    2    2    1    9    4   10   35   51  109  118  167   58   83 
##   19   20   21   22   23   24   25   26   27   28   29   30   31   32   33 
##   27   41   23   10   11    6   11    2    3    5    5   11    2    2    1 
##   35   36   38   40   44   45   48   53   57   61 NA's 
##    4    1    1    1    1    1    1    1    1    1   57

“How many cigarettes do you presently smoke on average?” (continuous [number cigarettes], v1_no_cig)

In the original item, the number of cigarettes is to be entered by the investigator, however there are three options to which timeframe these cigarettes refer to: per day, per week or per month. Here, we have decided to give the cigarettes per year.

Please note that people who have stopped smoking but less than three months ago are still labeled as smokers, therefore zeros can occur. For people presently do not smoke this question is coded as “-999”.

v1_clin_no_cig<-ifelse(v1_clin$v1_tabalk_ta1_jemals_ger==1, -999, 
                  ifelse(v1_clin$v1_tabalk_ta3_zig_pro_zeit==1, v1_clin$v1_tabalk_ta3_anz_zig*365,
                  ifelse(v1_clin$v1_tabalk_ta3_zig_pro_zeit==2, v1_clin$v1_tabalk_ta3_anz_zig*52,
                  ifelse(v1_clin$v1_tabalk_ta3_zig_pro_zeit==3, v1_clin$v1_tabalk_ta3_anz_zig*12,NA))))       

v1_con_no_cig<-ifelse(v1_con$v1_tabalk_tabak1==1, -999, 
                  ifelse(v1_con$v1_tabalk_tabak3_zeit==1, v1_con$v1_tabalk_ta3_anz_zig*365,
                  ifelse(v1_con$v1_tabalk_tabak3_zeit==2, v1_con$v1_tabalk_ta3_anz_zig*52,
                  ifelse(v1_con$v1_tabalk_tabak3_zeit==3, v1_con$v1_tabalk_ta3_anz_zig*12,NA))))                         

v1_no_cig<-c(v1_clin_no_cig,v1_con_no_cig)
summary(v1_no_cig)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##    -999    -999    1825    3384    7300   23725     380

Alcohol

“How often did you consume alcoholic beverages during the past twelve months?”" (ordinal [1,2,3,4,5,6,7], v1_alc_pst12_mths)

This is and ordinal item. Optional answers are: “never”-1, “only on special occasions”-2, “once per month or less”-3, “two to four times per month”-4, “two to three times per week”-5, “four times per week or several times but not daily”-6, “daily”-7.

v1_alc_pst12_mths<-factor(c(v1_clin$v1_tabalk_ta9_alkkonsum,v1_con$v1_tabalk_alkohol9), ordered=T)
descT(v1_alc_pst12_mths)
##                1    2    3    4    5    6   7   <NA>     
## [1,] No. cases 275  332  182  352  189  67  72  74   1543
## [2,] Percent   17.8 21.5 11.8 22.8 12.2 4.3 4.7 4.8  100

“On how many occasions during the past twelve months did you drink FIVE (men)/FOUR (women) or more alcoholic beverages?” (ordinal [1,2,3,4,5,6,7,8,9], v1_alc_5orm)

This is an ordinal item. Optional answers are: “never”-1, “once or twice”-2, “three to five times”-3, “six to eleven times”-4, “approximately once per month”-5, “two to three times per month”-6, “one to two times per week”-7, “three to four times per week”-8, “daily or almost daily”-9. Note that this item was skipped if participants chose answering alternatives 1, 2 or 3 in the previous question. In these cases, coding is -999.

v1_clin_alc_5orm<-ifelse((v1_clin$v1_tabalk_ta9_alkkonsum==1 | v1_clin$v1_tabalk_ta9_alkkonsum==2 | v1_clin$v1_tabalk_ta9_alkkonsum==3), 
                    -999,ifelse(is.na(v1_clin$v1_tabalk_ta10_alk_haeufigk_m)==T, 
                    v1_clin$v1_tabalk_ta11_alk_haeufigk_f,v1_clin$v1_tabalk_ta10_alk_haeufigk_m))

v1_con_alc_5orm<-ifelse((v1_con$v1_tabalk_alkohol9==1 | v1_con$v1_tabalk_alkohol9==2 | v1_con$v1_tabalk_alkohol9==3), 
                    -999,ifelse(is.na(v1_con$v1_tabalk_alkohol10)==T, 
                    v1_con$v1_tabalk_alkohol11,v1_con$v1_tabalk_alkohol10))

v1_alc_5orm<-factor(c(v1_clin_alc_5orm,v1_con_alc_5orm), ordered=T)
descT(v1_alc_5orm)
##                -999 1    2   3  4   5  6   7   8   9   <NA>     
## [1,] No. cases 789  213  98  93 64  61 70  43  17  14  81   1543
## [2,] Percent   51.1 13.8 6.4 6  4.1 4  4.5 2.8 1.1 0.9 5.2  100

Lifetime alcohol dependence? (dichotomous, v1_lftm_alc_dep)

The criteria for alcohol dependence are checked, resulting in a dichotomous assessment whether lifetime alcohol dependence is present.

v1_clin_lftm_alc_dep<-ifelse(v1_clin$v1_tabalk_ta12_alk_vorhanden==1,"N",ifelse(v1_clin$v1_tabalk_ta12_alk_vorhanden==3,"Y",NA))
v1_con_lftm_alc_dep<-ifelse(v1_con$v1_tabalk_alkohol_abhaengig==1,"N",ifelse(v1_con$v1_tabalk_alkohol_abhaengig==3,"Y",NA))

v1_lftm_alc_dep<-factor(c(v1_clin_lftm_alc_dep,v1_con_lftm_alc_dep))
descT(v1_lftm_alc_dep)
##                N    Y   <NA>     
## [1,] No. cases 1267 127 149  1543
## [2,] Percent   82.1 8.2 9.7  100

Illicit drugs

In the PsyCourse Study, much information on illigit drugs was collected. Specifically, at the first visit, it was assessed whether the participant ever consumed illicit drugs, and, if yes:

  • The name of each illicit drug ever consumed
  • The category of each illicit drug ever consumed
  • The frequency of consumption of each illicit drug during the period in which the drug was most heavily used
  • The time period over which each illicit drug was consumed
  • Whether each illicit drug was consumed in the past six months
  • How frequently each drug was consumed per month
  • Whether the individual developed tolerance to the drug

In the present dataset, only a few variables (see below and follow-up visits) are included if you want to undertake specific studies on illicit drugs, we can provide more specialized information.

Preparations for preparing data on illicit drugs

Check whether for each illicit drug, only one category is ticked (code and results not shown).

Clinical participants

Control participants

Recode several original items because they are wrongly coded in secuTrial exports (the graphical user interface and the exports do not match).

Assessment of frequency consumed when most frequently consumed

#clinical
#define function that recodes
v1_clin_mst_oft_recode <- function(drg_no) {

attach(v1_clin) 
v1_clin_ill_mst_frq_oftn_mod<-ifelse(eval(as.name(paste("v1_drogen_s_dga_haeufigk_30043_",drg_no,sep="")))==5,1,
                               ifelse(eval(as.name(paste("v1_drogen_s_dga_haeufigk_30043_",drg_no,sep="")))==4,5,
                                ifelse(eval(as.name(paste("v1_drogen_s_dga_haeufigk_30043_",drg_no,sep="")))==3,4,
                                 ifelse(eval(as.name(paste("v1_drogen_s_dga_haeufigk_30043_",drg_no,sep="")))==2,3,
                                  ifelse(eval(as.name(paste("v1_drogen_s_dga_haeufigk_30043_",drg_no,sep="")))==1,2,NA)))))
detach(v1_clin)   

assign(noquote(paste("v1_clin_drg_",drg_no,"_mst_frq_oftn",sep="")),v1_clin_ill_mst_frq_oftn_mod, envir=globalenv())
}

#apply function to all drugs (maximal number: 9)
for(no in c(1:9)){v1_clin_mst_oft_recode(no)}
  
#control
#define function that recodes
v1_con_mst_oft_recode <- function(drg_no) {

attach(v1_con) 
v1_con_ill_mst_frq_oftn_mod<-ifelse(eval(as.name(paste("v1_drogen_droge_haeufig_117983_",drg_no,sep="")))==5,1,
                               ifelse(eval(as.name(paste("v1_drogen_droge_haeufig_117983_",drg_no,sep="")))==4,5,
                                ifelse(eval(as.name(paste("v1_drogen_droge_haeufig_117983_",drg_no,sep="")))==3,4,
                                 ifelse(eval(as.name(paste("v1_drogen_droge_haeufig_117983_",drg_no,sep="")))==2,3,
                                  ifelse(eval(as.name(paste("v1_drogen_droge_haeufig_117983_",drg_no,sep="")))==1,2,NA)))))
detach(v1_con)  
assign(noquote(paste("v1_con_drg_",drg_no,"_mst_frq_oftn",sep="")),v1_con_ill_mst_frq_oftn_mod, envir=globalenv())
}

#apply function to all drugs (maximal number: 8)
for(no in c(1:8)){v1_con_mst_oft_recode(no)}

Assessment of frequency consumed in the past six months

v1_clin_pst_six_frq_recode <- function(drg_no) {

attach(v1_clin)
v1_clin_ill_pst_six_frq_mod<-ifelse(eval(as.name(paste("v1_drogen_s_dge_l6m_haeufig_30043_",drg_no,sep="")))==5,1,
                               ifelse(eval(as.name(paste("v1_drogen_s_dge_l6m_haeufig_30043_",drg_no,sep="")))==4,5,
                                ifelse(eval(as.name(paste("v1_drogen_s_dge_l6m_haeufig_30043_",drg_no,sep="")))==3,4,
                                 ifelse(eval(as.name(paste("v1_drogen_s_dge_l6m_haeufig_30043_",drg_no,sep="")))==2,3,
                                  ifelse(eval(as.name(paste("v1_drogen_s_dge_l6m_haeufig_30043_",drg_no,sep="")))==1,2,NA)))))
detach(v1_clin)

assign(noquote(paste("v1_clin_drg_",drg_no,"_pst_six_oftn",sep="")),v1_clin_ill_pst_six_frq_mod, envir=globalenv())
}

#apply function to all drugs (maximal number: 9)
for(no in c(1:9)){v1_clin_pst_six_frq_recode(no)}


v1_con_pst_six_frq_recode <- function(drg_no) {

attach(v1_con)
v1_con_ill_pst_six_frq_mod<-ifelse(eval(as.name(paste("v1_drogen_droge_letzte6m_117983_",drg_no,sep="")))==5,1,
                               ifelse(eval(as.name(paste("v1_drogen_droge_letzte6m_117983_",drg_no,sep="")))==4,5,
                                ifelse(eval(as.name(paste("v1_drogen_droge_letzte6m_117983_",drg_no,sep="")))==3,4,
                                 ifelse(eval(as.name(paste("v1_drogen_droge_letzte6m_117983_",drg_no,sep="")))==2,3,
                                  ifelse(eval(as.name(paste("v1_drogen_droge_letzte6m_117983_",drg_no,sep="")))==1,2,NA)))))
detach(v1_con) 
assign(noquote(paste("v1_con_drg_",drg_no,"_pst_six_oftn",sep="")),v1_con_ill_pst_six_frq_mod, envir=globalenv())
}

#apply function to all drugs (maximal number: 8)
for(no in c(1:8)){v1_con_pst_six_frq_recode(no)}

Prepare the illicit drug items contained in this dataset

“Have you ever taken illicit drugs?” (dichotomous, v1_evr_ill_drg)

v1_clin_evr_ill_drg<-ifelse(v1_clin$v1_drogen_dg1_konsum==2, "Y", "N")
v1_con_evr_ill_drg<-ifelse(v1_con$v1_drogen_drogenkonsum==2, "Y", "N")

v1_evr_ill_drg<-factor(c(v1_clin_evr_ill_drg,v1_con_evr_ill_drg))
descT(v1_evr_ill_drg)
##                N   Y    <NA>     
## [1,] No. cases 818 659  66   1543
## [2,] Percent   53  42.7 4.3  100

Make datasets containing only information on illicit drugs

v1_drg_clin<-v1_clin[,881:1023]
v1_drg_con<-v1_con[,505:631]

Create vectors containg the different names of the different drug categories (and their dataframes; see below)

v1_drg_cat<-c("sti","can","opi","kok","hal","inh","tra","var")
v1_drg_cat_df_clin<-c("v1_sti_cli","v1_can_cli","v1_opi_cli","v1_kok_cli","v1_hal_cli","v1_inh_cli","v1_tra_cli","v1_var_cli")
v1_drg_cat_df_con<-c("v1_sti_con","v1_can_con","v1_opi_con","v1_kok_con","v1_hal_con","v1_inh_con","v1_tra_con","v1_var_con")

names(v1_drg_cat_df_clin)<-c(1:8)
names(v1_drg_cat_df_con)<-c(1:8)

The following variables are created below:

“Number of stimulants drugs ever consumed” (continuous, v1_sti)
“Number of cannabis drugs ever consumed” (continuous, v1_can)
“Number of opioid drugs ever consumed” (continuous, v1_opi)
“Number of cocaine drugs ever consumed” (continuous, v1_kok)
“Number of hallucinogenic drugs ever consumed” (continuous, v1_hal)
“Number of inhalant drugs ever consumed” (continuous, v1_inh)
“Number of tranquillizer drugs ever consumed” (continuous, v1_tra)
“Number of other drugs ever consumed” (continuous, v1_var)

The category of each drug is classified by checking a checkbox, corresponding to the category (e.g. stimulants). Here, for each individual drug ever taken, I select each checkbox corresponding to the same category, and sum across these, resulting in the number of drugs from the category (e.g. “stimulants”) that was ever taken. The same is done for all other categories.

Create dataframes, each for a different drug category, separately for clinical and control individuals. The last column of each of these dataframes contains the count across the rows of each dataframe.

for(i in c(1:8)){
   assign(v1_drg_cat_df_clin[i],row_sums(v1_drg_clin[,grep(paste("v1_drogen_s_dg_drogekt",i,"_30043_",sep=""),names(v1_drg_clin))],var="v1_clin_evr",n=1))
   assign(v1_drg_cat_df_con[i],row_sums(v1_drg_con[,grep(paste("v1_drogen_droge",i,"_117983_",sep=""),names(v1_drg_con))],var="v1_con_evr",n=1))
}

Bind each last column of the dataframes created above together. This results in a dataframe, in which the number of drugs from each category a participant has EVER TAKEN are listed.

Clinical participants: Combine into one dataframe

v1_drg_evr_cats_clin<-data.frame(v1_sti_cli[,dim(v1_sti_cli)[2]],
                         v1_can_cli[,dim(v1_can_cli)[2]],
                         v1_opi_cli[,dim(v1_opi_cli)[2]],
                         v1_kok_cli[,dim(v1_kok_cli)[2]],
                         v1_hal_cli[,dim(v1_hal_cli)[2]],
                         v1_inh_cli[,dim(v1_inh_cli)[2]],
                         v1_tra_cli[,dim(v1_tra_cli)[2]],
                         v1_var_cli[,dim(v1_var_cli)[2]])

names(v1_drg_evr_cats_clin)<-paste("v1_",v1_drg_cat,"_cat_evr",sep="")

Control participants: Combine into one dataframe

v1_drg_evr_cats_con<-data.frame(v1_sti_con[,dim(v1_sti_con)[2]],
                         v1_can_con[,dim(v1_can_con)[2]],
                         v1_opi_con[,dim(v1_opi_con)[2]],
                         v1_kok_con[,dim(v1_kok_con)[2]],
                         v1_hal_con[,dim(v1_hal_con)[2]],
                         v1_inh_con[,dim(v1_inh_con)[2]],
                         v1_tra_con[,dim(v1_tra_con)[2]],
                         v1_var_con[,dim(v1_var_con)[2]])

names(v1_drg_evr_cats_con)<-names(v1_drg_evr_cats_clin)

**Combine clinical and control drug datasets into dataset drg_evr_cats

drg_evr_cats<-rbind(v1_drg_evr_cats_clin,v1_drg_evr_cats_con)

**“Was the participant ever a HEAVY USER of ANY DRUG? (dichotomous, v1_evr_hvy_usr)**

clin_evr_hvy_usr<-ifelse(apply(data.frame(v1_clin_drg_1_mst_frq_oftn,
                                          v1_clin_drg_2_mst_frq_oftn,
                                          v1_clin_drg_3_mst_frq_oftn,
                                          v1_clin_drg_4_mst_frq_oftn,
                                          v1_clin_drg_5_mst_frq_oftn,
                                          v1_clin_drg_6_mst_frq_oftn,
                                          v1_clin_drg_7_mst_frq_oftn,
                                          v1_clin_drg_8_mst_frq_oftn,
                                          v1_clin_drg_9_mst_frq_oftn), 1, function(m) any(m %in% c(4,5))),"Y","N")

con_evr_hvy_usr<-ifelse(apply(data.frame(v1_con_drg_1_mst_frq_oftn,
                                          v1_con_drg_2_mst_frq_oftn,
                                          v1_con_drg_3_mst_frq_oftn,
                                          v1_con_drg_4_mst_frq_oftn,
                                          v1_con_drg_5_mst_frq_oftn,
                                          v1_con_drg_6_mst_frq_oftn,
                                          v1_con_drg_7_mst_frq_oftn,
                                          v1_con_drg_8_mst_frq_oftn), 1, function(m) any(m %in% c(4,5))),"Y","N")

drg_evr_cats$evr_hvy_usr<-c(clin_evr_hvy_usr,con_evr_hvy_usr)

“During the past six months, did you take ANY illicit drugs?” (dichotomous, v1_pst6_ill_drg)

v1_clin_lst6_any<-ifelse(apply(v1_drg_clin[,grep("v1_drogen_s_dgd_letzte6m_30043_",names(v1_drg_clin))], 1, function(r) any(r %in% 1)),"Y","N")
v1_con_lst6_any<-ifelse(apply(v1_drg_con[,grep("v1_drogen_droge_letzte6m_117983_",names(v1_drg_con))], 1, function(r) any(r %in% 1)),"Y","N")

v1_pst6_ill_drg<-c(v1_clin_lst6_any,v1_con_lst6_any)
v1_pst6_ill_drg[is.na(v1_evr_ill_drg)]<-NA #make NA if this item was not assessed

IMPORTANT: Make all row in df drg_evr_cats NA in individuals in which the drug consumption section was NOT assessed.

drg_evr_cats[is.na(v1_evr_ill_drg),]<-NA

Create dataset

v1_subst<-data.frame(v1_ever_smkd,
                     v1_age_smk,
                     v1_no_cig,
                     v1_alc_pst12_mths,
                     v1_alc_5orm,
                     v1_lftm_alc_dep,
                     v1_evr_ill_drg,
                     drg_evr_cats,
                     v1_pst6_ill_drg)

Visit 1: DSM-IV Diagnosis (only in clinical participants)

Parts of the Structured Clinical Interview for DSM Disorders (SCID) were carried out (sections A Affective Syndromes, B Psychotic and Associated Symptoms, X Suicide attempts and suicidal ideation, and either section C (Differential diagnosis of Psychotic disorders) or section D (Differential diagnosis of Affective disorders). The most important variables of sections A, B, ans X are inclueded in this dataset, usually coded “Y”-yes, “N”-no and “U”-unknown.

Control participants have “-999” in every SCID variable.

Diagnosis according to DSM-IV

DSM-IV number diagnosis (categorical [295.10, 295.20, 295.30, 295.40, 295.60, 295.70, 295.90, 296.X, 296.3, 296.89, 298.80], v1_scid_dsm_dx)

We have included the DSM-IV diagnosis resulting from the combined efforts of a SCID interview and a screening of medical records (if available). Difficult cases were resolved by a discussion of experts.

v1_clin_scid_dsm_dx<-v1_clin$v1_skid_deckblatt_dsmiv_konsensusdiag_34407_1
v1_clin_scid_dsm_dx<-as.character(v1_clin_scid_dsm_dx)

v1_clin_scid_dsm_dx[v1_clin_scid_dsm_dx=="295.3"]<-"295.30"
v1_clin_scid_dsm_dx[v1_clin_scid_dsm_dx=="296.x"]<-"296.X"
v1_clin_scid_dsm_dx[v1_clin_scid_dsm_dx=="269.89"]<-"296.89"
v1_clin_scid_dsm_dx[v1_clin_scid_dsm_dx=="298.3"]<-"296.3"
v1_clin_scid_dsm_dx[v1_clin_scid_dsm_dx=="296.33"]<-"296.3"
v1_clin_scid_dsm_dx[v1_clin_scid_dsm_dx=="296.44"]<-"296.X"
v1_clin_scid_dsm_dx[v1_clin_scid_dsm_dx=="296.43"]<-"296.X"
v1_clin_scid_dsm_dx[v1_clin_scid_dsm_dx=="296.40"]<-"296.X"

v1_con_scid_dsm_dx<-rep("-999",dim(v1_con)[1])

v1_scid_dsm_dx<-c(v1_clin_scid_dsm_dx,v1_con_scid_dsm_dx)
descT(v1_scid_dsm_dx)
##                -999 295.10 295.20 295.30 295.40 295.60 295.70 295.90 296.3
## [1,] No. cases 320  14     10     436    12     4      101    12     91   
## [2,] Percent   20.7 0.9    0.6    28.3   0.8    0.3    6.5    0.8    5.9  
##      296.89 296.X 298.80     
## [1,] 110    427   6      1543
## [2,] 7.1    27.7  0.4    100

DSM-IV diagnosis categories (categorical [Depression, Schizophrenia, Schizoaffective Disorder, Brief Psychotic Disorder, Bipolar-I Disorder, Bipolar-II Disorder], v1_scid_dsm_dx_cat)

DSM-IV diagnoses in human readable form for non-clinical researchers. Please note the following: schizophrenia and schizoaffective disorder are often grouped together under the label schizophrenia, although these are two different disorders. Schizophreniform disorder is diagnosed when symptoms of schizophrenia are not (yet) present for the full six months required for a proper schizophrenia diagnosis. Brief psychotic disorder is distinct from schizophrenia. Bipolar-I disorder is diagnosed when both manic and depressive phases are present in an individual; a distinct diagnosis is bipolar-II in which “only” hypomanic and depressive phases are present. Bipolar-I and bipolar-II are both proper bipolar disorders. Control subjects are labeled as “Control”.

v1_clin_scid_dsm_dx_cat<-rep("NA",dim(v1_clin)[1])
v1_con_scid_dsm_dx_cat<-rep("NA",dim(v1_con)[1])

v1_clin_scid_dsm_dx_cat[v1_clin_scid_dsm_dx %in% c("295.10", "295.20", "295.30", "295.60", 
                               "295.90")]<-"Schizophrenia"
v1_clin_scid_dsm_dx_cat[v1_clin_scid_dsm_dx %in% c("295.70")]<-"Schizoaffective Disorder"
v1_clin_scid_dsm_dx_cat[v1_clin_scid_dsm_dx %in% c("295.40")]<-"Schizophreniform Disorder"
v1_clin_scid_dsm_dx_cat[v1_clin_scid_dsm_dx %in% c("298.80")]<-"Brief Psychotic Disorder"
v1_clin_scid_dsm_dx_cat[v1_clin_scid_dsm_dx %in% c("296.X")]<-"Bipolar-I Disorder"
v1_clin_scid_dsm_dx_cat[v1_clin_scid_dsm_dx %in% c("296.89")]<-"Bipolar-II Disorder"
v1_clin_scid_dsm_dx_cat[v1_clin_scid_dsm_dx %in% c("296.3")]<-"Depression"

v1_con_scid_dsm_dx_cat<-rep("Control",dim(v1_con)[1])

v1_scid_dsm_dx_cat<-c(v1_clin_scid_dsm_dx_cat,v1_con_scid_dsm_dx_cat)
descT(v1_scid_dsm_dx_cat)
##                Bipolar-I Disorder Bipolar-II Disorder
## [1,] No. cases 427                110                
## [2,] Percent   27.7               7.1                
##      Brief Psychotic Disorder Control Depression Schizoaffective Disorder
## [1,] 6                        320     91         101                     
## [2,] 0.4                      20.7    5.9        6.5                     
##      Schizophrenia Schizophreniform Disorder     
## [1,] 476           12                        1543
## [2,] 30.8          0.8                       100

The following items were assessed in clincal participants only!

A Affective Syndromes

Major depressive episode (MDE)**

Age at first MDD episode (continuous [years], v1_scid_age_MDE) This item includes all individuals that ever fulfilled MDD criteria. Also a person with e.g. schizophrenia can have a value on this item. If the individual ever fulfilled MDD criteria, the age at the first MDD episode is given. NA on this item means that age at first MDD episode is missing. Individuals that never experienced an MDD episode are coded as “-999”.

Control individiuals are coded as “-999”.

v1_clin_scid_age_MDE<-ifelse(is.na(v1_clin$v1_sna_21_mde1_a79_beurteilung),-999,
  ifelse(v1_clin$v1_sna_21_mde1_a79_beurteilung==3, v1_clin$v1_sna_21_mde1_s_snx_alter_jahre_30038_1, 
       ifelse((v1_clin$v1_sna_21_mde1_a79_beurteilung==1 | v1_clin$v1_sna_21_mde1_a79_beurteilung==0), -999, NA)))

descT(v1_clin_scid_age_MDE)
##                -999 2   4   6   7   8   9   10  11  12 13  14  15  16  17 
## [1,] No. cases 355  1   1   3   4   1   4   8   10  12 13  26  21  39  39 
## [2,] Percent   29   0.1 0.1 0.2 0.3 0.1 0.3 0.7 0.8 1  1.1 2.1 1.7 3.2 3.2
##      18  19  20  21  22 23  24  25  26  27  28  29 30  31  32 33  34 35 
## [1,] 34  44  40  41  24 30  34  34  21  27  19  12 30  17  25 13  12 8  
## [2,] 2.8 3.6 3.3 3.4 2  2.5 2.8 2.8 1.7 2.2 1.6 1  2.5 1.4 2  1.1 1  0.7
##      36  37  38  39  40  41 42  43 44  45  46  47  48  49  50  51  52  53 
## [1,] 10  13  5   6   14  12 10  12 5   14  4   8   8   5   8   2   8   5  
## [2,] 0.8 1.1 0.4 0.5 1.1 1  0.8 1  0.4 1.1 0.3 0.7 0.7 0.4 0.7 0.2 0.7 0.4
##      54  55  56  57  58  59  60  61  69  <NA>     
## [1,] 3   2   2   1   1   1   3   1   1   57   1223
## [2,] 0.2 0.2 0.2 0.1 0.1 0.1 0.2 0.1 0.1 4.7  100
v1_scid_age_MDE<-c(v1_clin_scid_age_MDE,rep(-999,dim(v1_con)[1]))
descT(v1_scid_age_MDE)
##                -999 2   4   6   7   8   9   10  11  12  13  14  15  16 
## [1,] No. cases 675  1   1   3   4   1   4   8   10  12  13  26  21  39 
## [2,] Percent   43.7 0.1 0.1 0.2 0.3 0.1 0.3 0.5 0.6 0.8 0.8 1.7 1.4 2.5
##      17  18  19  20  21  22  23  24  25  26  27  28  29  30  31  32  33 
## [1,] 39  34  44  40  41  24  30  34  34  21  27  19  12  30  17  25  13 
## [2,] 2.5 2.2 2.9 2.6 2.7 1.6 1.9 2.2 2.2 1.4 1.7 1.2 0.8 1.9 1.1 1.6 0.8
##      34  35  36  37  38  39  40  41  42  43  44  45  46  47  48  49  50 
## [1,] 12  8   10  13  5   6   14  12  10  12  5   14  4   8   8   5   8  
## [2,] 0.8 0.5 0.6 0.8 0.3 0.4 0.9 0.8 0.6 0.8 0.3 0.9 0.3 0.5 0.5 0.3 0.5
##      51  52  53  54  55  56  57  58  59  60  61  69  <NA>     
## [1,] 2   8   5   3   2   2   1   1   1   3   1   1   57   1543
## [2,] 0.1 0.5 0.3 0.2 0.1 0.1 0.1 0.1 0.1 0.2 0.1 0.1 3.7  100

Number of MDD episodes (continuous [number], v1_scid_no_MDE) In individuals that ever fulfilled MDD criteria, the number of MDD episodes is given. Please note the following:

  • NA on this item means that the number of MDD episodes is missing.
  • Individuals that never experienced an MDD episode are coded as “-999”.
  • If the episodes could only be poorly delimited from each other, “99” was coded.
v1_clin_scid_no_MDE<-ifelse(is.na(v1_clin$v1_sna_21_mde1_a79_beurteilung),-999,
  ifelse(v1_clin$v1_sna_21_mde1_a79_beurteilung==3, v1_clin$v1_sna_21_mde1_a81_anzahl, 
       ifelse((v1_clin$v1_sna_21_mde1_a79_beurteilung==1 | v1_clin$v1_sna_21_mde1_a79_beurteilung==0), -999, NA)))

descT(v1_clin_scid_no_MDE)
##                -999 1   2   3   4   5   6   7   8   9   10  11  12  13 
## [1,] No. cases 355  71  93  90  79  60  34  17  32  9   38  7   14  3  
## [2,] Percent   29   5.8 7.6 7.4 6.5 4.9 2.8 1.4 2.6 0.7 3.1 0.6 1.1 0.2
##      14  15  16  17  18  20  21  22  23  25  26  29  30 32  35  36  39 
## [1,] 4   17  2   3   1   18  1   1   1   3   2   2   12 1   1   1   1  
## [2,] 0.3 1.4 0.2 0.2 0.1 1.5 0.1 0.1 0.1 0.2 0.2 0.2 1  0.1 0.1 0.1 0.1
##      40  50  60  70  75  99   <NA>     
## [1,] 2   3   2   1   1   188  53   1223
## [2,] 0.2 0.2 0.2 0.1 0.1 15.4 4.3  100
v1_scid_no_MDE<-c(v1_clin_scid_no_MDE,rep(-999,dim(v1_con)[1])) #add -999 for control individuals
descT(v1_scid_no_MDE)
##                -999 1   2  3   4   5   6   7   8   9   10  11  12  13  14 
## [1,] No. cases 675  71  93 90  79  60  34  17  32  9   38  7   14  3   4  
## [2,] Percent   43.7 4.6 6  5.8 5.1 3.9 2.2 1.1 2.1 0.6 2.5 0.5 0.9 0.2 0.3
##      15  16  17  18  20  21  22  23  25  26  29  30  32  35  36  39  40 
## [1,] 17  2   3   1   18  1   1   1   3   2   2   12  1   1   1   1   2  
## [2,] 1.1 0.1 0.2 0.1 1.2 0.1 0.1 0.1 0.2 0.1 0.1 0.8 0.1 0.1 0.1 0.1 0.1
##      50  60  70  75  99   <NA>     
## [1,] 3   2   1   1   188  53   1543
## [2,] 0.2 0.1 0.1 0.1 12.2 3.4  100

Mania and hypomania

Age at first manic episode (continuous, v1_scid_age_mania) This item includes all individuals that ever fulfilled mania criteria. Also a person with e.g. schizophrenia can have a value on this item. If the individual ever fulfilled mania criteria, the age at the first manic episode is given. NA on this item means that age at first mania episode is missing.

Individuals that never experienced a manic episode are coded as “-999”.

Control individiuals are coded as “-999”.

v1_clin_scid_age_mania<-ifelse(is.na(v1_clin$v1_sna_23_manie1_a142_beurteilung),-999,
  ifelse(v1_clin$v1_sna_23_manie1_a142_beurteilung==3, v1_clin$v1_sna_24_hypomane1_a143_alter_jahre, 
       ifelse((v1_clin$v1_sna_23_manie1_a142_beurteilung==1 | v1_clin$v1_sna_23_manie1_a142_beurteilung==0), -999, NA)))

descT(v1_clin_scid_age_mania)
##                -999 5   10  11  12  13  14  15  16  17 18  19 20  21  22 
## [1,] No. cases 693  1   1   2   2   3   6   9   18  12 18  12 31  15  18 
## [2,] Percent   56.7 0.1 0.1 0.2 0.2 0.2 0.5 0.7 1.5 1  1.5 1  2.5 1.2 1.5
##      23  24  25  26  27  28  29  30 31  32  33  34  35  36  37  38  39 
## [1,] 21  21  31  16  17  15  9   12 7   6   9   17  5   8   8   8   5  
## [2,] 1.7 1.7 2.5 1.3 1.4 1.2 0.7 1  0.6 0.5 0.7 1.4 0.4 0.7 0.7 0.7 0.4
##      40  41  42  43  44  45  46  47  48  49  50  51  52  53  54  55  56 
## [1,] 14  14  8   6   6   9   5   3   2   4   4   4   2   4   3   2   3  
## [2,] 1.1 1.1 0.7 0.5 0.5 0.7 0.4 0.2 0.2 0.3 0.3 0.3 0.2 0.3 0.2 0.2 0.2
##      57  59  60  61  65  <NA>     
## [1,] 3   1   2   1   2   65   1223
## [2,] 0.2 0.1 0.2 0.1 0.2 5.3  100
v1_scid_age_mania<-c(v1_clin_scid_age_mania,rep(-999,dim(v1_con)[1])) #add -999 for control individuals
descT(v1_scid_age_mania)
##                -999 5   10  11  12  13  14  15  16  17  18  19  20 21 22 
## [1,] No. cases 1013 1   1   2   2   3   6   9   18  12  18  12  31 15 18 
## [2,] Percent   65.7 0.1 0.1 0.1 0.1 0.2 0.4 0.6 1.2 0.8 1.2 0.8 2  1  1.2
##      23  24  25 26 27  28 29  30  31  32  33  34  35  36  37  38  39  40 
## [1,] 21  21  31 16 17  15 9   12  7   6   9   17  5   8   8   8   5   14 
## [2,] 1.4 1.4 2  1  1.1 1  0.6 0.8 0.5 0.4 0.6 1.1 0.3 0.5 0.5 0.5 0.3 0.9
##      41  42  43  44  45  46  47  48  49  50  51  52  53  54  55  56  57 
## [1,] 14  8   6   6   9   5   3   2   4   4   4   2   4   3   2   3   3  
## [2,] 0.9 0.5 0.4 0.4 0.6 0.3 0.2 0.1 0.3 0.3 0.3 0.1 0.3 0.2 0.1 0.2 0.2
##      59  60  61  65  <NA>     
## [1,] 1   2   1   2   65   1543
## [2,] 0.1 0.1 0.1 0.1 4.2  100

Number of manic episodes (continuous [number], v1_scid_no_mania) In individuals that ever fulfilled criteria for mania, the number of mania episodes is given. Please note the following:

  • NA on this item means that the number of mania episodes is missing.
  • Individuals that never experienced an episode of mania are coded as “-999”.
  • If the episodes could only be poorly delimited from each other, “99” was coded.
v1_clin_scid_no_mania<-ifelse(is.na(v1_clin$v1_sna_23_manie1_a142_beurteilung),-999,
  ifelse(v1_clin$v1_sna_23_manie1_a142_beurteilung==3, v1_clin$v1_sna_24_hypomane1_a145_anzahl2, 
       ifelse((v1_clin$v1_sna_23_manie1_a142_beurteilung==1 | v1_clin$v1_sna_23_manie1_a142_beurteilung==0), -999, NA)))

descT(v1_clin_scid_no_mania)
##                -999 1   2   3   4   5   6   7  8   10 11  12  13  14  15 
## [1,] No. cases 693  83  68  54  35  34  19  12 14  24 2   4   1   2   3  
## [2,] Percent   56.7 6.8 5.6 4.4 2.9 2.8 1.6 1  1.1 2  0.2 0.3 0.1 0.2 0.2
##      17  20 22  24  25  30  50  96  99  <NA>     
## [1,] 1   12 1   1   1   4   1   1   47  106  1223
## [2,] 0.1 1  0.1 0.1 0.1 0.3 0.1 0.1 3.8 8.7  100
v1_scid_no_mania<-c(v1_clin_scid_no_mania,rep(-999,dim(v1_con)[1])) #add -999 for control individuals
descT(v1_scid_no_mania)
##                -999 1   2   3   4   5   6   7   8   10  11  12  13  14 
## [1,] No. cases 1013 83  68  54  35  34  19  12  14  24  2   4   1   2  
## [2,] Percent   65.7 5.4 4.4 3.5 2.3 2.2 1.2 0.8 0.9 1.6 0.1 0.3 0.1 0.1
##      15  17  20  22  24  25  30  50  96  99 <NA>     
## [1,] 3   1   12  1   1   1   4   1   1   47 106  1543
## [2,] 0.2 0.1 0.8 0.1 0.1 0.1 0.3 0.1 0.1 3  6.9  100

Age at first hypomanic episode (continuous, v1_scid_age_hypomania) This item includes all individuals that ever fulfilled criteria for hypomania, but never fullfilled criteria for mania. Also a person with e.g. schizophrenia can have a value on this item. If the individual ever fulfilled hypomania criteria (without ever fulfilling criteria of mania), the age at the first hypomanic episode is given. NA on this item means that age at first hypomanic episode is missing.

Individuals that never experienced a hypomanic episode, or had one or more mania episodes, are coded as “-999”.

Control individiuals are coded as “-999”.

v1_clin_scid_age_hypomania<-ifelse(is.na(v1_clin$v1_sna_24_hypomane1_a_160_beurteilung),-999,
  ifelse(v1_clin$v1_sna_24_hypomane1_a_160_beurteilung==3, v1_clin$v1_sna_24_hypomane1_a160a_alter_jahre, 
       ifelse((v1_clin$v1_sna_24_hypomane1_a_160_beurteilung==1 | v1_clin$v1_sna_24_hypomane1_a_160_beurteilung==0), -999, NA)))

descT(v1_clin_scid_age_hypomania)
##                -999 13  15  16  17  18  19  20  21  22  23  24  25  26 
## [1,] No. cases 1101 2   5   4   1   3   7   4   6   5   7   1   4   3  
## [2,] Percent   90   0.2 0.4 0.3 0.1 0.2 0.6 0.3 0.5 0.4 0.6 0.1 0.3 0.2
##      27  28  29  30  31  32  33  34  35  36  37  38  40  42  43  45  46 
## [1,] 4   1   2   3   2   3   2   3   2   2   3   2   2   1   1   2   2  
## [2,] 0.3 0.1 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.1 0.1 0.2 0.2
##      47  48  50  51  53  54  55  65  <NA>     
## [1,] 1   1   2   1   1   4   4   1   18   1223
## [2,] 0.1 0.1 0.2 0.1 0.1 0.3 0.3 0.1 1.5  100
v1_scid_age_hypomania<-c(v1_clin_scid_age_hypomania,rep(-999,dim(v1_con)[1])) #add -999 for control individuals
descT(v1_scid_age_hypomania)
##                -999 13  15  16  17  18  19  20  21  22  23  24  25  26 
## [1,] No. cases 1421 2   5   4   1   3   7   4   6   5   7   1   4   3  
## [2,] Percent   92.1 0.1 0.3 0.3 0.1 0.2 0.5 0.3 0.4 0.3 0.5 0.1 0.3 0.2
##      27  28  29  30  31  32  33  34  35  36  37  38  40  42  43  45  46 
## [1,] 4   1   2   3   2   3   2   3   2   2   3   2   2   1   1   2   2  
## [2,] 0.3 0.1 0.1 0.2 0.1 0.2 0.1 0.2 0.1 0.1 0.2 0.1 0.1 0.1 0.1 0.1 0.1
##      47  48  50  51  53  54  55  65  <NA>     
## [1,] 1   1   2   1   1   4   4   1   18   1543
## [2,] 0.1 0.1 0.1 0.1 0.1 0.3 0.3 0.1 1.2  100

Number of hypomanic episodes (continuous [number (but see below)], v1_scid_no_hypomania) In individuals that ever fulfilled criteria for hypomania, but never fullfilled criteria for mania, the number of hypomanic episodes is given. Please note the following:

  • NA on this item means that the number of hypomanic episode is missing.
  • Individuals that never experienced an episode of hypomania, or had one or more episodes of mania, are coded as “-999”.
  • If the episodes could only be poorly delimited from each other, “99” was coded.
v1_clin_scid_no_hypomania<-ifelse(is.na(v1_clin$v1_sna_24_hypomane1_a_160_beurteilung),-999,
  ifelse(v1_clin$v1_sna_24_hypomane1_a_160_beurteilung==3, v1_clin$v1_sna_24_hypomane1_a161_anzahl, 
       ifelse((v1_clin$v1_sna_24_hypomane1_a_160_beurteilung==1 | v1_clin$v1_sna_24_hypomane1_a_160_beurteilung==0), -999, NA)))

descT(v1_clin_scid_no_hypomania)
##                -999 1   2   3   4   5   6   7   8   10  12  14  15  18 
## [1,] No. cases 1101 19  14  9   7   4   2   5   2   5   1   1   2   1  
## [2,] Percent   90   1.6 1.1 0.7 0.6 0.3 0.2 0.4 0.2 0.4 0.1 0.1 0.2 0.1
##      20  30  50  70  75  99  <NA>     
## [1,] 2   1   1   1   1   13  31   1223
## [2,] 0.2 0.1 0.1 0.1 0.1 1.1 2.5  100
v1_scid_no_hypomania<-c(v1_clin_scid_no_hypomania,rep(-999,dim(v1_con)[1])) #add -999 for control individuals
descT(v1_scid_no_hypomania)
##                -999 1   2   3   4   5   6   7   8   10  12  14  15  18 
## [1,] No. cases 1421 19  14  9   7   4   2   5   2   5   1   1   2   1  
## [2,] Percent   92.1 1.2 0.9 0.6 0.5 0.3 0.1 0.3 0.1 0.3 0.1 0.1 0.1 0.1
##      20  30  50  70  75  99  <NA>     
## [1,] 2   1   1   1   1   13  31   1543
## [2,] 0.1 0.1 0.1 0.1 0.1 0.8 2    100

B Psychotic and associated symptoms

This section was assessed in all study participants. If at least one item covering delusions (delusion item) or hallucinations (hallucination item) was answered in the affirmative this was coded “Y”, otherwise “N”. Please note that an individual was also coded as “N” if there was insufficient information (“0” on the original SCID item; occuring only in few individuals) or if the symptom was too mild to fulfill criteria (“2” on the original SCID item).

NA means that at least one question was not completed and all other completed questions were coded “N”.

Ever experienced delusions? (dichotomous, v1_scid_ever_delus)

v1_clin_scid_ever_delus<-ifelse((is.na(v1_clin$v1_snb_31_prodsymp1_b12_beeinflusswahn) &
                                  is.na(v1_clin$v1_snb_31_prodsymp1_b13_gedankenentzug) &
                                  is.na(v1_clin$v1_snb_31_prodsymp1_b14_gedankenueber) &        
                                  v1_clin$v1_snb_31_prodsymp1_b1_beziehungswahn!=3 & 
                                  v1_clin$v1_snb_31_prodsymp1_b2_verfolgungswahn!=3 &
                                  v1_clin$v1_snb_31_prodsymp1_b3_groessenwahn!=3 &
                                  v1_clin$v1_snb_31_prodsymp1_b4_koerper_wahnideen!=3 &
                                  v1_clin$v1_snb_31_prodsymp1_b6_relig_wahnideen!=3 &
                                  v1_clin$v1_snb_31_prodsymp1_b7_schuld_wahnideen!=3 &
                                  v1_clin$v1_snb_31_prodsymp1_b8_eifer_wahnideen!=3 &
                                  v1_clin$v1_snb_31_prodsymp1_b9_liebe_wahnideen!=3 &
                                  v1_clin$v1_snb_31_prodsymp1_b10_nihilist_wahn!=3 &
                                  v1_clin$v1_snb_31_prodsymp1_b11_veram_wahn!=3 &
                                  v1_clin$v1_snb_31_prodsymp1_b12_sonstiger_wahn!=3), "N",
                            ifelse((v1_clin$v1_snb_31_prodsymp1_b12_beeinflusswahn!=3 &
                                  v1_clin$v1_snb_31_prodsymp1_b13_gedankenentzug!=3 &
                                  v1_clin$v1_snb_31_prodsymp1_b14_gedankenueber!=3 &        
                                  v1_clin$v1_snb_31_prodsymp1_b1_beziehungswahn!=3 & 
                                  v1_clin$v1_snb_31_prodsymp1_b2_verfolgungswahn!=3 &
                                  v1_clin$v1_snb_31_prodsymp1_b3_groessenwahn!=3 &
                                  v1_clin$v1_snb_31_prodsymp1_b4_koerper_wahnideen!=3 &
                                  v1_clin$v1_snb_31_prodsymp1_b6_relig_wahnideen!=3 &
                                  v1_clin$v1_snb_31_prodsymp1_b7_schuld_wahnideen!=3 &
                                  v1_clin$v1_snb_31_prodsymp1_b8_eifer_wahnideen!=3 &
                                  v1_clin$v1_snb_31_prodsymp1_b9_liebe_wahnideen!=3 &
                                  v1_clin$v1_snb_31_prodsymp1_b10_nihilist_wahn!=3 &
                                  v1_clin$v1_snb_31_prodsymp1_b11_veram_wahn!=3 &
                                  v1_clin$v1_snb_31_prodsymp1_b12_sonstiger_wahn!=3), "N",      
                          ifelse((v1_clin$v1_snb_31_prodsymp1_b1_beziehungswahn==3 | 
                                  v1_clin$v1_snb_31_prodsymp1_b2_verfolgungswahn==3 |
                                  v1_clin$v1_snb_31_prodsymp1_b3_groessenwahn==3 |
                                  v1_clin$v1_snb_31_prodsymp1_b4_koerper_wahnideen==3 |
                                  v1_clin$v1_snb_31_prodsymp1_b6_relig_wahnideen==3 |
                                  v1_clin$v1_snb_31_prodsymp1_b7_schuld_wahnideen==3 |
                                  v1_clin$v1_snb_31_prodsymp1_b8_eifer_wahnideen==3 |
                                  v1_clin$v1_snb_31_prodsymp1_b9_liebe_wahnideen==3 |
                                  v1_clin$v1_snb_31_prodsymp1_b10_nihilist_wahn==3 |
                                  v1_clin$v1_snb_31_prodsymp1_b11_veram_wahn==3 |
                                  v1_clin$v1_snb_31_prodsymp1_b12_sonstiger_wahn==3 |
                                  v1_clin$v1_snb_31_prodsymp1_b12_beeinflusswahn==3 |
                                  v1_clin$v1_snb_31_prodsymp1_b13_gedankenentzug==3 |
                                  v1_clin$v1_snb_31_prodsymp1_b14_gedankenueber==3),"Y",NA)))

v1_scid_ever_delus<-factor(c(v1_clin_scid_ever_delus,rep(-999,dim(v1_con)[1])))
summary(v1_scid_ever_delus)
## -999    N    Y NA's 
##  320  302  862   59

Ever experienced hallucinations? (dichotomous, v1_scid_ever_halls)

v1_clin_scid_ever_halls<-ifelse(v1_clin$v1_snb_31_prodsymp1_b21_olfaktor_halluz==3 | 
                       v1_clin$v1_snb_31_prodsymp1_b_21_gustator_halluz==3 |
                       v1_clin$v1_snb_31_prodsymp1_b20_taktil_halluz==3  |
                       v1_clin$v1_snb_31_prodsymp1_b19_opt_halluz==3 |
                       v1_clin$v1_snb_31_prodsymp1_b16_akust_halluz==3, "Y", "N")

v1_scid_ever_halls<-factor(c(v1_clin_scid_ever_halls,rep(-999,dim(v1_con)[1])))
summary(v1_scid_ever_halls)
## -999    N    Y NA's 
##  320  580  608   35

Ever experienced psychotic symptoms? (dichotomous, v1_scid_ever_psyc)

This item combines the two previous items. If ever delusional or ever hallucinations then yes. This is a crude operational definition of psychosis, as it takes into account only symptoms and not e.g. level of functioning or other aspects.

v1_clin_scid_ever_psyc<-ifelse(v1_clin_scid_ever_delus=="Y" | v1_clin_scid_ever_halls=="Y","Y","N")
v1_scid_ever_psyc<-factor(c(v1_clin_scid_ever_psyc,rep("-999",dim(v1_con)[1])))
summary(v1_scid_ever_psyc)
## -999    N    Y NA's 
##  320  276  884   63

Age at first occurence of psychotic symptoms (continuous [years], v1_scid_age_fst_psyc)

v1_clin_scid_age_fst_psy<-c(v1_clin$v1_snc_41_schizo4_c17_alter_jahre,rep(-999,dim(v1_con)[1]))
v1_scid_age_fst_psyc<-ifelse(v1_scid_ever_psyc=="Y",v1_clin_scid_age_fst_psy,-999)
summary(v1_scid_age_fst_psyc[v1_scid_age_fst_psyc>=0])
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##    6.00   21.00   27.00   29.22   35.00   73.00     543

Year in which first psychotic symptoms occured (continuous [year], v1_scid_yr_fst_psyc)

v1_clin_scid_yr_fst_psyc<-c(v1_clin$v1_snc_41_schizo4_c17_psycho_jahr,rep(-999,dim(v1_con)[1]))
v1_scid_yr_fst_psyc<-ifelse(v1_scid_ever_psyc=="Y",v1_clin_scid_yr_fst_psyc,-999)
descT(v1_scid_yr_fst_psyc)  
##                -999 1950 1962 1965 1967 1969 1970 1971 1973 1974 1975 1976
## [1,] No. cases 596  1    1    1    1    1    1    2    3    2    1    1   
## [2,] Percent   38.6 0.1  0.1  0.1  0.1  0.1  0.1  0.1  0.2  0.1  0.1  0.1 
##      1977 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991
## [1,] 6    3    1    6    1    3    5    4    3    4    10   5    4    8   
## [2,] 0.4  0.2  0.1  0.4  0.1  0.2  0.3  0.3  0.2  0.3  0.6  0.3  0.3  0.5 
##      1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005
## [1,] 6    9    5    9    14   6    9    16   11   13   14   15   11   14  
## [2,] 0.4  0.6  0.3  0.6  0.9  0.4  0.6  1    0.7  0.8  0.9  1    0.7  0.9 
##      2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 <NA>     
## [1,] 17   21   12   10   17   20   12   13   7    4    584  1543
## [2,] 1.1  1.4  0.8  0.6  1.1  1.3  0.8  0.8  0.5  0.3  37.8 100

X Suicide attempts and suicidal ideation

Ever suicidal ideation (dichotomous, v1_scid_evr_suic_ide)

Please not that the following items on suicidal ideation were skipped (and coded -999) if this question was not answered positively. The answer “insufficient information” was coded as -999.

v1_scid_evr_suic_ide<-c(rep(NA,dim(v1_clin)[1]),rep(-999,dim(v1_con)[1]))
                        
v1_scid_evr_suic_ide<-ifelse(c(v1_clin$v1_snx_112_suizged2_x7_suizid_gedanken,rep(-999,dim(v1_con)[1]))==0, -999,  
                      ifelse(c(v1_clin$v1_snx_112_suizged2_x7_suizid_gedanken,rep(-999,dim(v1_con)[1]))==1, "N", 
                      ifelse(c(v1_clin$v1_snx_112_suizged2_x7_suizid_gedanken,rep(-999,dim(v1_con)[1]))==3, "Y", 
                             v1_scid_evr_suic_ide))) 

descT(v1_scid_evr_suic_ide)
##                -999 N    Y    <NA>     
## [1,] No. cases 328  286  903  26   1543
## [2,] Percent   21.3 18.5 58.5 1.7  100

Suicidal ideation detailed (ordinal [1,2,3,4], v1_scid_suic_ide)

This is an ordinal item with the following gradation: “only fleeting thoughts”-1, “serious thoughts (details were elaborated)”-2, “persistent thoughts (serious and less serious)”-3, “options 2 and 3 together”-4. The item is coded “-999” if skipped (see above).

v1_scid_suic_ide<-c(rep(NA,dim(v1_clin)[1]),rep(-999,dim(v1_con)[1]))

v1_scid_suic_ide<-ifelse(v1_scid_evr_suic_ide!="Y", -999,
                         ifelse(c(v1_clin$v1_snx_112_suizged2_x8_suizged_inhalt,rep(-999,dim(v1_con)[1]))==1, 1, 
                          ifelse(c(v1_clin$v1_snx_112_suizged2_x8_suizged_inhalt,rep(-999,dim(v1_con)[1]))==2, 2, 
                            ifelse(c(v1_clin$v1_snx_112_suizged2_x8_suizged_inhalt,rep(-999,dim(v1_con)[1]))==3, 3, 
                              ifelse(c(v1_clin$v1_snx_112_suizged2_x8_suizged_inhalt==4,rep(-999,dim(v1_con)[1])), 4,                                                v1_scid_suic_ide)))))

v1_scid_suic_ide<-factor(v1_scid_suic_ide,ordered=T)
descT(v1_scid_suic_ide)
##                -999 1    2   3   4    <NA>     
## [1,] No. cases 614  291  123 128 330  57   1543
## [2,] Percent   39.8 18.9 8   8.3 21.4 3.7  100

Thoughts about methods (ordinal [1,2,3], v1_scid_suic_thght_mth)

This is an ordinal item with the following gradation: “no”-1, “yes, but no details”-2, “yes, including details”-3. The item is coded “-999” if skipped (see above).

v1_scid_suic_thght_mth<-c(rep(NA,dim(v1_clin)[1]),rep(-999,dim(v1_con)[1]))
v1_scid_suic_thght_mth<-ifelse(v1_scid_evr_suic_ide!="Y", -999,
                        ifelse(c(v1_clin$v1_snx_112_suizged2_x10_suiz_methoden,rep(-999,dim(v1_con)[1]))==1, 1, 
                        ifelse(c(v1_clin$v1_snx_112_suizged2_x10_suiz_methoden,rep(-999,dim(v1_con)[1]))==2, 2, 
                        ifelse(c(v1_clin$v1_snx_112_suizged2_x10_suiz_methoden,rep(-999,dim(v1_con)[1]))==3, 3,
                        v1_scid_suic_thght_mth))))

v1_scid_suic_thght_mth<-factor(v1_scid_suic_thght_mth,ordered=T)
descT(v1_scid_suic_thght_mth)
##                -999 1    2    3    <NA>     
## [1,] No. cases 614  264  276  316  73   1543
## [2,] Percent   39.8 17.1 17.9 20.5 4.7  100

Suicidal ideation: suicide note or similar [German:“Abschiedshandlung”] (ordinal [1,2,3,4], v1_scid_suic_note_thgts)

This is on ordinal item with the following gradation: “no”-1, “having thought about”-2, “persistent thoughts (serious and less serious)”-3, “options 2 and 3 together”-4. The item is coded “-999” if skipped (see above).

v1_scid_suic_note_thgts<-c(rep(NA,dim(v1_clin)[1]),rep(-999,dim(v1_con)[1]))
v1_scid_suic_note_thgts<-ifelse(v1_scid_evr_suic_ide!="Y", -999,
                          ifelse(c(v1_clin$v1_snx_112_suizged2_x11_best_erledigt,rep(-999,dim(v1_con)[1]))==1, 1,  
                            ifelse(c(v1_clin$v1_snx_112_suizged2_x11_best_erledigt,rep(-999,dim(v1_con)[1]))==2, 2,  
                              ifelse(c(v1_clin$v1_snx_112_suizged2_x11_best_erledigt,rep(-999,dim(v1_con)[1]))==3, 3, 
                                ifelse(c(v1_clin$v1_snx_112_suizged2_x11_best_erledigt,rep(-999,dim(v1_con)[1]))==4, 4,             v1_scid_suic_note_thgts)))))  
                
v1_scid_suic_note_thgts<-factor(v1_scid_suic_note_thgts,ordered=T)
descT(v1_scid_suic_note_thgts)
##                -999 1    2   3   4   <NA>     
## [1,] No. cases 614  657  45  28  116 83   1543
## [2,] Percent   39.8 42.6 2.9 1.8 7.5 5.4  100

Suicide attempt (categorical [1,2,3], v1_suic_attmpt)

This is on ordinal item with the following gradation: “no”-1, “interruption of attempt”-2, “yes”-3. Please not that the following items on suicidal attempt were skipped if this question was answered with “no”.The answer “insufficient information was coded as -999.

v1_suic_attmpt<-c(rep(NA,dim(v1_clin)[1]),rep(-999,dim(v1_con)[1]))
v1_suic_attmpt<-ifelse(c(v1_clin$v1_snx_111_suizvrs2_x1_suiz_vers,rep(-999,dim(v1_con)[1]))==0, -999, 
                  ifelse(c(v1_clin$v1_snx_111_suizvrs2_x1_suiz_vers,rep(-999,dim(v1_con)[1]))==1, 1, 
                    ifelse(c(v1_clin$v1_snx_111_suizvrs2_x1_suiz_vers,rep(-999,dim(v1_con)[1]))==2, 2, 
                      ifelse(c(v1_clin$v1_snx_111_suizvrs2_x1_suiz_vers,rep(-999,dim(v1_con)[1]))==3, 3, 
                             v1_suic_attmpt)))) 

v1_suic_attmpt<-factor(v1_suic_attmpt,ordered=T)
descT(v1_suic_attmpt)
##                -999 1    2   3    <NA>     
## [1,] No. cases 330  777  51  354  31   1543
## [2,] Percent   21.4 50.4 3.3 22.9 2    100

Number of suicide attempts (ordinal [1,2,3,4,5,6], v1_scid_no_suic_attmpt)

This is on ordinal item with the following gradation: “1 time”-1, “2 times”-2, “3-times”-3, “4 times”-4, “5 times”-5, “6 or more times”-6. The item is coded “-999” if skipped (see above).

v1_scid_no_suic_attmpt<-c(rep(NA,dim(v1_clin)[1]),rep(-999,dim(v1_con)[1]))

v1_scid_no_suic_attmpt<-ifelse(v1_suic_attmpt==1, -999, 
                ifelse(v1_suic_attmpt>1, c(v1_clin$v1_snx_111_suizvrs2_x2_suiz_anz,rep(-999,dim(v1_con)[1])), v1_scid_no_suic_attmpt))
           
v1_scid_no_suic_attmpt<-factor(v1_scid_no_suic_attmpt,ordered=T)
descT(v1_scid_no_suic_attmpt)
##                -999 1    2  3   <NA>     
## [1,] No. cases 1097 221  93 79  53   1543
## [2,] Percent   71.1 14.3 6  5.1 3.4  100

Preparation of suicide attempt (ordinal [1,2,3,4], v1_prep_suic_attp_ord)

This is an ordinal item with the following gradation: “no preparation (impulsive attempt)”-1, “little preparation”-2, “moderate preparation”-3, “Extensive, all details planned”-4. The item is coded “-999” if skipped (see above).

v1_prep_suic_attp_ord<-c(rep(NA,dim(v1_clin)[1]),rep(-999,dim(v1_con)[1]))

v1_prep_suic_attp_ord<-ifelse(v1_suic_attmpt==1, -999, 
                          ifelse(v1_suic_attmpt>1 & 
                                   c(v1_clin$v1_snx_111_suizvrs2_x5_suiz_vorb,rep(-999,dim(v1_con)[1]))==1, 1,
                          ifelse(v1_suic_attmpt>1 & 
                                   c(v1_clin$v1_snx_111_suizvrs2_x5_suiz_vorb,rep(-999,dim(v1_con)[1]))==2, 2,     
                          ifelse(v1_suic_attmpt>1 & 
                                   c(v1_clin$v1_snx_111_suizvrs2_x5_suiz_vorb,rep(-999,dim(v1_con)[1]))==3, 3,
                          ifelse(v1_suic_attmpt>1 & 
                                   c(v1_clin$v1_snx_111_suizvrs2_x5_suiz_vorb,rep(-999,dim(v1_con)[1]))==4, 4,
                              v1_prep_suic_attp_ord))))) 

v1_prep_suic_attp_ord<-factor(v1_prep_suic_attp_ord,ordered=T)
descT(v1_prep_suic_attp_ord)
##                -999 1   2   3   4   <NA>     
## [1,] No. cases 1097 118 36  72  132 88   1543
## [2,] Percent   71.1 7.6 2.3 4.7 8.6 5.7  100

Suicidal attempt: suicide note or similar [German:“Abschiedshandlung”] (ordinal [1,2,3,4], v1_suic_note_attmpt)

This is on ordinal item with the following gradation: “no”-1, “having thought about”-2, “persistent thoughts (serious and less serious)”-3, “options 2 and 3 together”-4. The item is coded “-999” if skipped (see above).

v1_suic_note_attmpt<-c(rep(NA,dim(v1_clin)[1]),rep(-999,dim(v1_con)[1]))

v1_suic_note_attmpt<-ifelse(v1_suic_attmpt==1, -999, 
                     ifelse(v1_suic_attmpt>1 & c(v1_clin$v1_snx_111_suizvrs2_x6_abschiedshdl
,rep(-999,dim(v1_con)[1]))==1, "1",
                     ifelse(v1_suic_attmpt>1 & c(v1_clin$v1_snx_111_suizvrs2_x6_abschiedshdl
,rep(-999,dim(v1_con)[1]))==2, "2",
                     ifelse(v1_suic_attmpt>1 & c(v1_clin$v1_snx_111_suizvrs2_x6_abschiedshdl
,rep(-999,dim(v1_con)[1]))==3, "3",
                     ifelse(v1_suic_attmpt>1 & c(v1_clin$v1_snx_111_suizvrs2_x6_abschiedshdl
,rep(-999,dim(v1_con)[1]))==4, "4",
                            v1_suic_note_attmpt))))) 

v1_suic_note_attmpt<-factor(v1_suic_note_attmpt,ordered=T)
descT(v1_suic_note_attmpt)
##                -999 1    2   3   4   <NA>     
## [1,] No. cases 1097 250  17  17  90  72   1543
## [2,] Percent   71.1 16.2 1.1 1.1 5.8 4.7  100

Create dataset

v1_scid<-data.frame(v1_scid_dsm_dx,
                    v1_scid_dsm_dx_cat,
                    v1_scid_age_MDE,
                    v1_scid_no_MDE,
                    v1_scid_age_mania,
                    v1_scid_no_mania,
                    v1_scid_age_hypomania,
                    v1_scid_no_hypomania,
                    v1_scid_ever_halls,
                    v1_scid_ever_delus,
                    v1_scid_ever_psyc,
                    v1_scid_age_fst_psyc,
                    v1_scid_yr_fst_psyc,
                    v1_scid_evr_suic_ide,
                    v1_scid_suic_ide,
                    v1_scid_suic_thght_mth,
                    v1_scid_suic_note_thgts,
                    v1_suic_attmpt,
                    v1_scid_no_suic_attmpt,
                    v1_prep_suic_attp_ord,
                    v1_suic_note_attmpt)

Visit 1: Symptom rating scales (interviewer rates individual)

Positive and Negative Sydrome Scale (PANSS)

The PANSS (Kay, Fiszbein, & Opler, 1987) is a rating scale measuring positive and negative symptoms in schizophrenia. It has three subscales: positive, negative and gereral psychopathology symptoms. Each item is rated on an ordinal scale from one to seven with the following gradation: “absent”-1, “minimal”-2, “mild”-3, “moderate”-4, “moderate severe”-5, “severe”-6, “extreme”-7. On all items, higher scores mean more severe symptoms. The ratings refer to the past seven days. Please find the items below.

Positive subscale

P1 Delusions (ordinal [1,2,3,4,5,6,7], v1_panss_p1)

v1_panss_p1<-c(v1_clin$v1_panss_p_p1_wahnideen,v1_con$v1_panss_p_p1_wahnideen)
v1_panss_p1<-factor(v1_panss_p1, ordered=T)
descT(v1_panss_p1)
##                1    2   3   4   5   6   <NA>     
## [1,] No. cases 983  96  144 110 60  49  101  1543
## [2,] Percent   63.7 6.2 9.3 7.1 3.9 3.2 6.5  100

P2 Conceptual disorganization (ordinal [1,2,3,4,5,6,7], v1_panss_p2)

v1_panss_p2<-c(v1_clin$v1_panss_p_p2_form_denkst,v1_con$v1_panss_p_p2_form_denkst)
v1_panss_p2<-factor(v1_panss_p2, ordered=T)

descT(v1_panss_p2)
##                1    2   3    4   5  6   7   <NA>     
## [1,] No. cases 898  170 209  110 46 8   1   101  1543
## [2,] Percent   58.2 11  13.5 7.1 3  0.5 0.1 6.5  100

P3 Hallucinatory behavior (ordinal [1,2,3,4,5,6,7], v1_panss_p3)

v1_panss_p3<-c(v1_clin$v1_panss_p_p3_halluz,v1_con$v1_panss_p_p3_halluz)
v1_panss_p3<-factor(v1_panss_p3, ordered=T)

descT(v1_panss_p3)
##                1    2   3   4   5   6  7   <NA>     
## [1,] No. cases 1188 76  66  56  40  15 1   101  1543
## [2,] Percent   77   4.9 4.3 3.6 2.6 1  0.1 6.5  100

P4 Excitement (ordinal [1,2,3,4,5,6,7], v1_panss_p4)

v1_panss_p4<-c(v1_clin$v1_panss_p_p4_erregung,v1_con$v1_panss_p_p4_erregung)
v1_panss_p4<-factor(v1_panss_p4, ordered=T)

descT(v1_panss_p4)
##                1    2   3    4   5   6   <NA>     
## [1,] No. cases 961  147 251  58  17  3   106  1543
## [2,] Percent   62.3 9.5 16.3 3.8 1.1 0.2 6.9  100

P5 Grandiosity (ordinal [1,2,3,4,5,6,7], v1_panss_p5)

v1_panss_p5<-c(v1_clin$v1_panss_p_p5_groessenideen,v1_con$v1_panss_p_p5_groessenideen)
v1_panss_p5<-factor(v1_panss_p5, ordered=T)

descT(v1_panss_p5)
##                1    2   3   4   5   6   <NA>     
## [1,] No. cases 1197 100 84  34  17  6   105  1543
## [2,] Percent   77.6 6.5 5.4 2.2 1.1 0.4 6.8  100

P6 Suspiciousness/persecution (ordinal [1,2,3,4,5,6,7], v1_panss_p6)

v1_panss_p6<-c(v1_clin$v1_panss_p_p6_misstr_verfolg,v1_con$v1_panss_p_p6_misstr_verfolg)
v1_panss_p6<-factor(v1_panss_p6, ordered=T)

descT(v1_panss_p6)
##                1    2   3    4   5  6   7   <NA>     
## [1,] No. cases 1023 144 173  56  31 12  1   103  1543
## [2,] Percent   66.3 9.3 11.2 3.6 2  0.8 0.1 6.7  100

P7 Hostility (ordinal [1,2,3,4,5,6,7], v1_panss_p7)

v1_panss_p7<-c(v1_clin$v1_panss_p_p7_feindseligkeit,v1_con$v1_panss_p_p7_feindseligkeit)
v1_panss_p7<-factor(v1_panss_p7, ordered=T)

descT(v1_panss_p7)
##                1    2   3   4  5   <NA>     
## [1,] No. cases 1245 96  76  16 4   106  1543
## [2,] Percent   80.7 6.2 4.9 1  0.3 6.9  100

PANSS Positive sum score (continuous [7-49], v1_panss_sum_pos)

v1_panss_sum_pos<-as.numeric.factor(v1_panss_p1)+
                  as.numeric.factor(v1_panss_p2)+
                  as.numeric.factor(v1_panss_p3)+
                  as.numeric.factor(v1_panss_p4)+
                  as.numeric.factor(v1_panss_p5)+
                  as.numeric.factor(v1_panss_p6)+
                  as.numeric.factor(v1_panss_p7)

summary(v1_panss_sum_pos)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##    7.00    7.00    8.50   10.81   13.00   35.00     117

Negative subscale

N1 Blunted affect (ordinal [1,2,3,4,5,6,7], v1_panss_n1)

v1_panss_n1<-c(v1_clin$v1_panss_n_n1_affektverflachung,v1_con$v1_panss_n_n1_affektverflachung)
v1_panss_n1<-factor(v1_panss_n1, ordered=T)

descT(v1_panss_n1)
##                1    2    3    4   5   6   7   <NA>     
## [1,] No. cases 781  174  205  148 111 18  1   105  1543
## [2,] Percent   50.6 11.3 13.3 9.6 7.2 1.2 0.1 6.8  100

N2 Emotional withdrawal (ordinal [1,2,3,4,5,6,7], v1_panss_n2)

v1_panss_n2<-c(v1_clin$v1_panss_n_n2_emot_rueckzug,v1_con$v1_panss_n_n2_emot_rueckzug)
v1_panss_n2<-factor(v1_panss_n2, ordered=T)

descT(v1_panss_n2)
##                1    2    3    4    5   6   7   <NA>     
## [1,] No. cases 866  165  188  172  34  10  1   107  1543
## [2,] Percent   56.1 10.7 12.2 11.1 2.2 0.6 0.1 6.9  100

N3 Poor rapport (ordinal [1,2,3,4,5,6,7], v1_panss_n3)

v1_panss_n3<-c(v1_clin$v1_panss_n_n3_mang_aff_rapp,v1_con$v1_panss_n_n3_mang_aff_rapp)
v1_panss_n3<-factor(v1_panss_n3, ordered=T)

descT(v1_panss_n3)
##                1    2    3    4   5   6   <NA>     
## [1,] No. cases 973  165  191  78  28  4   104  1543
## [2,] Percent   63.1 10.7 12.4 5.1 1.8 0.3 6.7  100

N4 Passive/apathetic social withdrawal (ordinal [1,2,3,4,5,6,7], v1_panss_n4)

v1_panss_n4<-c(v1_clin$v1_panss_n_n4_soz_pass_apath,v1_con$v1_panss_n_n4_soz_pass_apath)
v1_panss_n4<-factor(v1_panss_n4, ordered=T)

descT(v1_panss_n4)
##                1    2   3    4   5   6   <NA>     
## [1,] No. cases 881  141 252  109 45  9   106  1543
## [2,] Percent   57.1 9.1 16.3 7.1 2.9 0.6 6.9  100

N5 difficulty in abstract thinking (ordinal [1,2,3,4,5,6,7], v1_panss_n5)

v1_panss_n5<-c(v1_clin$v1_panss_n_n5_abstr_denken,v1_con$v1_panss_n_n5_abstr_denken)
v1_panss_n5<-factor(v1_panss_n5, ordered=T)

descT(v1_panss_n5)
##                1    2    3    4   5   6  <NA>     
## [1,] No. cases 875  160  244  95  36  16 117  1543
## [2,] Percent   56.7 10.4 15.8 6.2 2.3 1  7.6  100

N6 Lack of spontaneity and flow of conversation (ordinal [1,2,3,4,5,6,7], v1_panss_n6)

v1_panss_n6<-c(v1_clin$v1_panss_n_n6_spon_fl_sprache,v1_con$v1_panss_n_n6_spon_fl_sprache)
v1_panss_n6<-factor(v1_panss_n6, ordered=T)

descT(v1_panss_n6)
##                1    2   3   4   5   6   <NA>     
## [1,] No. cases 1060 136 132 72  33  3   107  1543
## [2,] Percent   68.7 8.8 8.6 4.7 2.1 0.2 6.9  100

N7 Stereotyped thinking (ordinal [1,2,3,4,5,6,7], v1_panss_n7)

v1_panss_n7<-c(v1_clin$v1_panss_n_n7_stereotyp_ged,v1_con$v1_panss_n_n7_stereotyp_ged)
v1_panss_n7<-factor(v1_panss_n7, ordered=T)

descT(v1_panss_n7)
##                1    2   3   4   5   6   <NA>     
## [1,] No. cases 1096 138 144 42  11  5   107  1543
## [2,] Percent   71   8.9 9.3 2.7 0.7 0.3 6.9  100

PANSS Negative sum score (continuous [7-49], v1_panss_sum_neg)

v1_panss_sum_neg<-as.numeric.factor(v1_panss_n1)+
                  as.numeric.factor(v1_panss_n2)+
                  as.numeric.factor(v1_panss_n3)+
                  as.numeric.factor(v1_panss_n4)+
                  as.numeric.factor(v1_panss_n5)+
                  as.numeric.factor(v1_panss_n6)+
                  as.numeric.factor(v1_panss_n7)

summary(v1_panss_sum_neg)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##    7.00    7.00   10.00   12.22   16.00   38.00     136

General psychopathology subscale

G1 Somatic concerns (ordinal [1,2,3,4,5,6,7], v1_panss_g1)

v1_panss_g1<-c(v1_clin$v1_panss_g_g1_sorge_gesundh,v1_con$v1_panss_g_g1_sorge_gesundh)
v1_panss_g1<-factor(v1_panss_g1, ordered=T)

descT(v1_panss_g1)
##                1    2    3    4   5   6   7   <NA>     
## [1,] No. cases 954  176  177  83  34  9   3   107  1543
## [2,] Percent   61.8 11.4 11.5 5.4 2.2 0.6 0.2 6.9  100

G2 Anxiety (ordinal [1,2,3,4,5,6,7], v1_panss_g2)

v1_panss_g2<-c(v1_clin$v1_panss_g_g2_angst,v1_con$v1_panss_g_g2_angst)
v1_panss_g2<-factor(v1_panss_g2, ordered=T)

descT(v1_panss_g2)
##                1    2   3    4   5   6   7   <NA>     
## [1,] No. cases 828  149 283  123 45  6   1   108  1543
## [2,] Percent   53.7 9.7 18.3 8   2.9 0.4 0.1 7    100

G3 Guilt feelings (ordinal [1,2,3,4,5,6,7], v1_panss_g3)

v1_panss_g3<-c(v1_clin$v1_panss_g_g3_schuldgefuehle,v1_con$v1_panss_g_g3_schuldgefuehle)
v1_panss_g3<-factor(v1_panss_g3, ordered=T)

descT(v1_panss_g3)
##                1    2    3    4   5   6   7   <NA>     
## [1,] No. cases 960  156  176  111 29  5   1   105  1543
## [2,] Percent   62.2 10.1 11.4 7.2 1.9 0.3 0.1 6.8  100

G4 Tension (ordinal [1,2,3,4,5,6,7], v1_panss_g4)

v1_panss_g4<-c(v1_clin$v1_panss_g_g4_anspannung,v1_con$v1_panss_g_g4_anspannung)
v1_panss_g4<-factor(v1_panss_g4, ordered=T)

descT(v1_panss_g4)
##                1    2    3    4   5   6   <NA>     
## [1,] No. cases 815  213  266  115 22  6   106  1543
## [2,] Percent   52.8 13.8 17.2 7.5 1.4 0.4 6.9  100

G5 Mannerisms & posturing (ordinal [1,2,3,4,5,6,7], v1_panss_g5)

v1_panss_g5<-c(v1_clin$v1_panss_g_g5_manier_koerperh,v1_con$v1_panss_g_g5_manier_koerperh)
v1_panss_g5<-factor(v1_panss_g5, ordered=T)

descT(v1_panss_g5)
##                1    2   3   4   5   6   7   <NA>     
## [1,] No. cases 1221 111 71  20  6   8   1   105  1543
## [2,] Percent   79.1 7.2 4.6 1.3 0.4 0.5 0.1 6.8  100

G6 Depression (ordinal [1,2,3,4,5,6,7], v1_panss_g6)

v1_panss_g6<-c(v1_clin$v1_panss_g_g6_depression,v1_con$v1_panss_g_g6_depression)
v1_panss_g6<-factor(v1_panss_g6, ordered=T)

descT(v1_panss_g6)
##                1    2   3    4   5   6  7   <NA>     
## [1,] No. cases 722  154 251  185 106 16 4   105  1543
## [2,] Percent   46.8 10  16.3 12  6.9 1  0.3 6.8  100

G7 Motor retardation (ordinal [1,2,3,4,5,6,7], v1_panss_g7)

v1_panss_g7<-c(v1_clin$v1_panss_g_g7_mot_verlangs,v1_con$v1_panss_g_g7_mot_verlangs)
v1_panss_g7<-factor(v1_panss_g7, ordered=T)

descT(v1_panss_g7)
##                1    2    3    4   5   6   <NA>     
## [1,] No. cases 896  175  237  102 23  5   105  1543
## [2,] Percent   58.1 11.3 15.4 6.6 1.5 0.3 6.8  100

G8 Uncooperativeness (ordinal [1,2,3,4,5,6,7], v1_panss_g8)

v1_panss_g8<-c(v1_clin$v1_panss_g_g8_unkoop_verh,v1_con$v1_panss_g_g8_unkoop_verh)
v1_panss_g8<-factor(v1_panss_g8, ordered=T)

descT(v1_panss_g8)
##                1    2   3   4   5   6   <NA>     
## [1,] No. cases 1296 75  50  12  3   2   105  1543
## [2,] Percent   84   4.9 3.2 0.8 0.2 0.1 6.8  100

G9 Unusual thought content (ordinal [1,2,3,4,5,6,7], v1_panss_g9)

v1_panss_g9<-c(v1_clin$v1_panss_g_g9_ungew_denkinh,v1_con$v1_panss_g_g9_ungew_denkinh)
v1_panss_g9<-factor(v1_panss_g9, ordered=T)

descT(v1_panss_g9)
##                1    2   3    4   5   6   7   <NA>     
## [1,] No. cases 1056 91  163  74  44  12  1   102  1543
## [2,] Percent   68.4 5.9 10.6 4.8 2.9 0.8 0.1 6.6  100

G10 Disorientation (ordinal [1,2,3,4,5,6,7], v1_panss_g10)

v1_panss_g10<-c(v1_clin$v1_panss_g_g10_desorient,v1_con$v1_panss_g_g10_desorient)
v1_panss_g10<-factor(v1_panss_g10, ordered=T)

descT(v1_panss_g10)
##                1    2   3  4   5   6   <NA>     
## [1,] No. cases 1269 99  61 4   4   2   104  1543
## [2,] Percent   82.2 6.4 4  0.3 0.3 0.1 6.7  100

G11 Poor attention (ordinal [1,2,3,4,5,6,7], v1_panss_g11)

v1_panss_g11<-c(v1_clin$v1_panss_g_g11_mang_aufmerks,v1_con$v1_panss_g_g11_mang_aufmerks)
v1_panss_g11<-factor(v1_panss_g11, ordered=T)

descT(v1_panss_g11)
##                1    2    3    4   5   6   <NA>     
## [1,] No. cases 775  172  332  125 27  3   109  1543
## [2,] Percent   50.2 11.1 21.5 8.1 1.7 0.2 7.1  100

G12 Lack of judgement & insight (ordinal [1,2,3,4,5,6,7], v1_panss_g12)

v1_panss_g12<-c(v1_clin$v1_panss_g_g12_mang_urt_einsi,v1_con$v1_panss_g_g12_mang_urt_einsi)
v1_panss_g12<-factor(v1_panss_g12, ordered=T)

descT(v1_panss_g12)
##                1    2   3   4   5  6   7   <NA>     
## [1,] No. cases 1116 132 101 66  15 7   1   105  1543
## [2,] Percent   72.3 8.6 6.5 4.3 1  0.5 0.1 6.8  100

G13 Disturbance of volition (ordinal [1,2,3,4,5,6,7], v1_panss_g13)

v1_panss_g13<-c(v1_clin$v1_panss_g_g13_willensschwae,v1_con$v1_panss_g_g13_willensschwae)
v1_panss_g13<-factor(v1_panss_g13, ordered=T)

descT(v1_panss_g13)
##                1    2   3   4   5   <NA>     
## [1,] No. cases 1173 111 112 37  2   108  1543
## [2,] Percent   76   7.2 7.3 2.4 0.1 7    100

G14 Poor impulse control (ordinal [1,2,3,4,5,6,7], v1_panss_g14)

v1_panss_g14<-c(v1_clin$v1_panss_g_g14_mang_impulsk,v1_con$v1_panss_g_g14_mang_impulsk)
v1_panss_g14<-factor(v1_panss_g14, ordered=T)

descT(v1_panss_g14)
##                1    2   3   4   5   6   <NA>     
## [1,] No. cases 1173 102 136 20  1   2   109  1543
## [2,] Percent   76   6.6 8.8 1.3 0.1 0.1 7.1  100

G15 Preoccupation (ordinal [1,2,3,4,5,6,7], v1_panss_g15)

v1_panss_g15<-c(v1_clin$v1_panss_g_g15_selbstbezog,v1_con$v1_panss_g_g15_selbstbezog)
v1_panss_g15<-factor(v1_panss_g15, ordered=T)

descT(v1_panss_g15)
##                1    2   3   4   5   6   <NA>     
## [1,] No. cases 1180 110 100 40  8   1   104  1543
## [2,] Percent   76.5 7.1 6.5 2.6 0.5 0.1 6.7  100

G16 Active social avoidance (ordinal [1,2,3,4,5,6,7], v1_panss_g16)

v1_panss_g16<-c(v1_clin$v1_panss_g_g16_aktsoz_vermeid,v1_con$v1_panss_g_g16_aktsoz_vermeid)
v1_panss_g16<-factor(v1_panss_g16, ordered=T)

descT(v1_panss_g16)
##                1    2   3    4   5   6   <NA>     
## [1,] No. cases 991  141 203  65  30  6   107  1543
## [2,] Percent   64.2 9.1 13.2 4.2 1.9 0.4 6.9  100

PANSS General Psychopathology sum score (continuous [16-112], v1_panss_sum_gen)

v1_panss_sum_gen<-as.numeric.factor(v1_panss_g1)+
                  as.numeric.factor(v1_panss_g2)+
                  as.numeric.factor(v1_panss_g3)+
                  as.numeric.factor(v1_panss_g4)+
                  as.numeric.factor(v1_panss_g5)+
                  as.numeric.factor(v1_panss_g6)+
                  as.numeric.factor(v1_panss_g7)+
                  as.numeric.factor(v1_panss_g8)+
                  as.numeric.factor(v1_panss_g9)+
                  as.numeric.factor(v1_panss_g10)+
                  as.numeric.factor(v1_panss_g11)+
                  as.numeric.factor(v1_panss_g12)+
                  as.numeric.factor(v1_panss_g13)+
                  as.numeric.factor(v1_panss_g14)+
                  as.numeric.factor(v1_panss_g15)+
                  as.numeric.factor(v1_panss_g16)

summary(v1_panss_sum_gen)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   16.00   18.00   23.00   25.31   31.00   74.00     147

Create PANSS Total score (continuous [30-210], v1_panss_sum_tot)

v1_panss_sum_tot<-v1_panss_sum_pos+v1_panss_sum_neg+v1_panss_sum_gen
summary(v1_panss_sum_tot)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   30.00   33.00   44.00   48.39   58.00  141.00     188

Create dataset

v1_symp_panss<-data.frame(v1_panss_p1,v1_panss_p2,v1_panss_p3,v1_panss_p4,v1_panss_p5,v1_panss_p6,v1_panss_p7,
                          v1_panss_n1,v1_panss_n2,v1_panss_n3,v1_panss_n4,v1_panss_n5,v1_panss_n6,v1_panss_n7,
                          v1_panss_g1,v1_panss_g2,v1_panss_g3,v1_panss_g4,v1_panss_g5,v1_panss_g6,v1_panss_g7,
                          v1_panss_g8,v1_panss_g9,v1_panss_g10,v1_panss_g11,v1_panss_g12,v1_panss_g13,v1_panss_g14,
                          v1_panss_g15,v1_panss_g16,v1_panss_sum_pos,v1_panss_sum_neg,v1_panss_sum_gen,
                          v1_panss_sum_tot)

Inventory of depressive symptomatology (IDS-C30)

The IDS-C30 is is a 30-item rating scale used to assess the severity of depressive symptoms. Each item is rated on an ordinal scale from zero to three with zero indicating absence of the respective symptom. One item, #9, has additional information. The ratings refer to the past seven days. On all items, higher scores indicate more severe symptoms. Please find the items below.

Item 1 Sleep onset insomnia (ordinal [0,1,2,3], v1_idsc_itm1)

v1_idsc_itm1<-c(v1_clin$v1_ids_c_s1_ids1_einschlafschw,v1_con$v1_ids_c_s1_ids1_einschlafschw)
v1_idsc_itm1<-factor(v1_idsc_itm1, ordered=T)

descT(v1_idsc_itm1)
##                0    1    2   3   <NA>     
## [1,] No. cases 996  218  111 102 116  1543
## [2,] Percent   64.5 14.1 7.2 6.6 7.5  100

Item 2 Mid-nocturnal insomnia (ordinal [0,1,2,3], v1_idsc_itm2)

v1_idsc_itm2<-c(v1_clin$v1_ids_c_s1_ids2_naechtl_aufw,v1_con$v1_ids_c_s1_ids2_naechtl_aufw)
v1_idsc_itm2<-factor(v1_idsc_itm2, ordered=T)

descT(v1_idsc_itm2)
##                0   1    2    3   <NA>     
## [1,] No. cases 880 224  173  148 118  1543
## [2,] Percent   57  14.5 11.2 9.6 7.6  100

Item 3 Early morning insomnia (ordinal [0,1,2,3], v1_idsc_itm3)

v1_idsc_itm3<-c(v1_clin$v1_ids_c_s1_ids3_frueh_aufw,v1_con$v1_ids_c_s1_ids3_frueh_aufw)
v1_idsc_itm3<-factor(v1_idsc_itm3, ordered=T)

descT(v1_idsc_itm3)
##                0    1   2   3  <NA>     
## [1,] No. cases 1133 101 97  92 120  1543
## [2,] Percent   73.4 6.5 6.3 6  7.8  100

Item 4 Hypersomnia (ordinal [0,1,2,3], v1_idsc_itm4)

v1_idsc_itm4<-c(v1_clin$v1_ids_c_s1_ids4_hypersomnie,v1_con$v1_ids_c_s1_ids4_hypersomnie)
v1_idsc_itm4<-factor(v1_idsc_itm4, ordered=T)

descT(v1_idsc_itm4)
##                0    1    2   3   <NA>     
## [1,] No. cases 947  305  138 28  125  1543
## [2,] Percent   61.4 19.8 8.9 1.8 8.1  100

Item 5 Mood (sad) (ordinal [0,1,2,3], v1_idsc_itm5)

v1_idsc_itm5<-c(v1_clin$v1_ids_c_s1_ids5_stimmung_trgk,v1_con$v1_ids_c_s1_ids5_stimmung_trgk)
v1_idsc_itm5<-factor(v1_idsc_itm5, ordered=T)

descT(v1_idsc_itm5)
##                0    1    2   3   <NA>     
## [1,] No. cases 807  397  133 84  122  1543
## [2,] Percent   52.3 25.7 8.6 5.4 7.9  100

Item 6 Mood (irritable) (ordinal [0,1,2,3], v1_idsc_itm6)

v1_idsc_itm6<-c(v1_clin$v1_ids_c_s1_ids6_stimmung_grzt,v1_con$v1_ids_c_s1_ids6_stimmung_grzt)
v1_idsc_itm6<-factor(v1_idsc_itm6, ordered=T)

descT(v1_idsc_itm6)
##                0    1    2   3   <NA>     
## [1,] No. cases 1042 292  55  35  119  1543
## [2,] Percent   67.5 18.9 3.6 2.3 7.7  100

Item 7 Mood (anxious) (ordinal [0,1,2,3], v1_idsc_itm7)

v1_idsc_itm7<-c(v1_clin$v1_ids_c_s1_ids7_stimmung_agst,v1_con$v1_ids_c_s1_ids7_stimmung_agst)
v1_idsc_itm7<-factor(v1_idsc_itm7, ordered=T)

descT(v1_idsc_itm7)
##                0    1   2   3   <NA>     
## [1,] No. cases 909  308 131 72  123  1543
## [2,] Percent   58.9 20  8.5 4.7 8    100

Item 8 Reactivity of mood (ordinal [0,1,2,3], v1_idsc_itm8)

v1_idsc_itm8<-c(v1_clin$v1_ids_c_s1_ids8_reakt_stimmung,v1_con$v1_ids_c_s1_ids8_reakt_stimmung)
v1_idsc_itm8<-factor(v1_idsc_itm8, ordered=T)

descT(v1_idsc_itm8)
##                0    1    2   3   <NA>     
## [1,] No. cases 1126 181  74  42  120  1543
## [2,] Percent   73   11.7 4.8 2.7 7.8  100

Item 9 Mood Variation (ordinal [0,1,2,3], v1_idsc_itm9)

v1_idsc_itm9<-c(v1_clin$v1_ids_c_s1_ids9_stimmungsschw,v1_con$v1_ids_c_s1_ids9_stimmungsschw)
v1_idsc_itm9<-factor(v1_idsc_itm9, ordered=T)

descT(v1_idsc_itm9)
##                0    1   2   3   <NA>     
## [1,] No. cases 1057 128 82  149 127  1543
## [2,] Percent   68.5 8.3 5.3 9.7 8.2  100

Item 9A (categorical [M, A, N], v1_idsc_itm9a)
Additional information if the answer on item 9 was 1,2 or 3: “When was the mood usually worse?” (“M”-morning, “A”-afternoon, “N”-night).

v1_idsc_itm9a_pre<-c(v1_clin$v1_ids_c_s1_ids9a_stimmungsschw,v1_con$v1_ids_c_s1_ids9a_stimmungsschw)

v1_idsc_itm9a<-rep(NA,dim(v1_clin)[1]+dim(v1_con)[1])
v1_idsc_itm9a<-ifelse(v1_idsc_itm9!=0 & v1_idsc_itm9a_pre==1, "M", ifelse(v1_idsc_itm9==0, -999, v1_idsc_itm9a))
v1_idsc_itm9a<-ifelse(v1_idsc_itm9!=0 & v1_idsc_itm9a_pre==2, "A", ifelse(v1_idsc_itm9==0, -999, v1_idsc_itm9a))
v1_idsc_itm9a<-ifelse(v1_idsc_itm9!=0 & v1_idsc_itm9a_pre==3, "N", ifelse(v1_idsc_itm9==0, -999, v1_idsc_itm9a))
v1_idsc_itm9a<-factor(v1_idsc_itm9a, ordered=F)

descT(v1_idsc_itm9a)
##                -999 A  M    N   <NA>     
## [1,] No. cases 1057 15 160  64  247  1543
## [2,] Percent   68.5 1  10.4 4.1 16   100

Item 9B (dichotomous, v1_idsc_itm9b) Additional information if the answer on item 9 was 1,2 or 3: “Is mood variation attributed to environment by the patient?”.

v1_idsc_itm9b_pre<-c(v1_clin$v1_ids_c_s1_ids9b_stimmungsschw,v1_con$v1_ids_c_s1_ids9b_stimmungsschw)

v1_idsc_itm9b<-rep(NA,dim(v1_clin)[1]+dim(v1_con)[1])
v1_idsc_itm9b<-ifelse(v1_idsc_itm9!=0 & v1_idsc_itm9b_pre==0, "N", ifelse(v1_idsc_itm9==0, -999, v1_idsc_itm9b))
v1_idsc_itm9b<-ifelse(v1_idsc_itm9!=0 & v1_idsc_itm9b_pre==1, "Y", ifelse(v1_idsc_itm9==0, -999, v1_idsc_itm9b))
v1_idsc_itm9b<-factor(v1_idsc_itm9b, ordered=F)

descT(v1_idsc_itm9b)
##                -999 N   Y   <NA>     
## [1,] No. cases 1057 107 84  295  1543
## [2,] Percent   68.5 6.9 5.4 19.1 100

Item 10 Quality of mood (ordinal [0,1,2,3], v1_idsc_itm10)

v1_idsc_itm10<-c(v1_clin$v1_ids_c_s1_ids10_quali_stimmung,v1_con$v1_ids_c_s1_ids10_quali_stimmung)
v1_idsc_itm10<-factor(v1_idsc_itm10, ordered=T)

descT(v1_idsc_itm10)
##                0    1   2  3   <NA>     
## [1,] No. cases 1108 103 61 135 136  1543
## [2,] Percent   71.8 6.7 4  8.7 8.8  100

Items 11-14 Appetite and weight
Please not that item 11 assesses decreased appetite and item 13 assesses weight loss during the past two weeks. Item 12 assesses increased appetite and item 14 weight gain during the past two weeks.

The interviewer is supposed to rate either items 11 and 13 or items 12 and 14.

Item 11 (ordinal [0,1,2,3], v1_idsc_itm11)

v1_idsc_app_verm<-c(v1_clin$v1_ids_c_s2_ids11_appetit_verm,v1_con$v1_ids_c_s2_ids11_appetit_verm)
v1_idsc_app_gest<-c(v1_clin$v1_ids_c_s2_ids12_appetit_steig,v1_con$v1_ids_c_s2_ids12_appetit_steig)

v1_idsc_itm11<-rep(NA,dim(v1_clin)[1]+dim(v1_con)[1])
v1_idsc_itm11<-ifelse(is.na(v1_idsc_app_verm)==T & is.na(v1_idsc_app_gest)==T, NA, 
                  ifelse(is.na(v1_idsc_app_verm)==T & is.na(v1_idsc_app_gest)==F, -999,                
                  ifelse(is.na(v1_idsc_app_verm)==F & is.na(v1_idsc_app_gest)==T,          
                         v1_idsc_app_verm, 
                     ifelse(is.na(v1_idsc_app_verm)==F & is.na(v1_idsc_app_gest)==F & (v1_idsc_app_verm>v1_idsc_app_gest), v1_idsc_app_verm,
                     ifelse(is.na(v1_idsc_app_verm)==F & is.na(v1_idsc_app_gest)==F & (v1_idsc_app_gest>=v1_idsc_app_verm),-999,v1_idsc_itm11)))))