Skip to content
Open
Show file tree
Hide file tree
Changes from 45 commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
3f1fd0c
Template version of description despression ICD10 2011W3
Leafrancia Sep 14, 2022
c1ff3c4
Description depression ICD10 - first draft
Leafrancia Sep 15, 2022
17ee222
Template version of description despression ICD10 2011W3
Leafrancia Sep 14, 2022
708fca8
Description depression ICD10 - first draft
Leafrancia Sep 15, 2022
4541217
Merge branch 'bugfix/depression-c2011w3' of https://github.com/CCOMS-…
DaniMori Sep 15, 2022
c4b3503
Review of the bugfix of Depression-ICD10 in c2011w3 (#11)
DaniMori Sep 20, 2022
52f053f
Contact person updated - resolved issue #9
Leafrancia Sep 20, 2022
fa4a346
Review "number of valid cases" per variable #10 - Resolved issue of u…
Leafrancia Sep 22, 2022
ce03811
Instert pdf outcome
Leafrancia Sep 22, 2022
0260d8d
Sets column markdown wrapping to 80 for the description document.
DaniMori Sep 22, 2022
31f5bb1
Code aligned (for readability)
DaniMori Sep 22, 2022
7c8755c
Syntax for the ICD11 depression variables - first attempt
Leafrancia Oct 5, 2022
d353d3a
Fix and precise the ICD-11 criteria and symptoms
Leafrancia Oct 6, 2022
176609c
No severity variable here
Leafrancia Oct 6, 2022
4c7baa0
Syntax for ICD11, cohorte 2019 wave 1 - First proposition
Leafrancia Oct 14, 2022
f1dcd4e
Deletes files that should not belong to this branch
DaniMori Oct 18, 2022
f12ed31
Proposition of a syntax - ICD11 for cohorte 2019 wave 1
Leafrancia Oct 18, 2022
c089f2b
Delete the wrong version
Leafrancia Oct 18, 2022
c0033f2
Merge branch 'feature/c2019/w1/depression-icd11' of https://github.co…
Leafrancia Oct 18, 2022
5c2d427
Add proxy variable in "variables to keep" for the outcome's creation
Leafrancia Oct 18, 2022
c6dde11
review the comments and changes requested on Github
Leafrancia Oct 20, 2022
f367b33
Columns arrangement
Leafrancia Oct 20, 2022
243f8fb
Table is reformatted to avoid that the variable names are cut
DaniMori Oct 21, 2022
a6ab671
Comments reviewed
Leafrancia Oct 21, 2022
720aa64
Add citation
Leafrancia Oct 21, 2022
08cd03c
Restores table
DaniMori Oct 21, 2022
ce2fd4a
Resolves conflict in table reformatting
DaniMori Oct 21, 2022
06ccd54
Restores expression in `bibliography` field in yaml header
DaniMori Oct 21, 2022
aa30675
Minor changes reviewed and changed
Leafrancia Oct 31, 2022
ddaf256
Bibliography file changed to automatic path
Leafrancia Oct 31, 2022
c247b5b
Revisions of the code according to the acclamation of doubts, deletio…
Leafrancia Nov 10, 2022
3530cc1
Restores "variable information" table format
DaniMori Nov 11, 2022
3809f6c
Avoids the ambiguous interpretation "reduced fatigue"
DaniMori Nov 11, 2022
9310b9c
Revision of the name of criteria
Leafrancia Nov 11, 2022
10fe6c5
Arranging the error message about conflict
Leafrancia Nov 11, 2022
ca7741a
Review symptoms organisation
Leafrancia Nov 11, 2022
6a8e9ac
Arranging symptoms and clusters names
Leafrancia Nov 11, 2022
1449bed
Restores "variable information" table format
DaniMori Nov 14, 2022
100c449
Formats with indentation the list of symptom clusters.
DaniMori Nov 14, 2022
948152d
Aligns code, for clarity of interpretation
DaniMori Nov 14, 2022
860f0ba
Reflows all comments in syntax to a width of 80 characters maximum.
DaniMori Nov 14, 2022
f232eb6
Reorders criteria 4 and 5 to match the order in the "Explantion" section
DaniMori Nov 14, 2022
41e5bf6
Adds headers in the syntax for the three symptom clusters.
DaniMori Nov 14, 2022
b5d8d7b
Adding information about critera
Leafrancia Nov 15, 2022
61b06ac
Clarification of symptoms
Leafrancia Nov 16, 2022
3613d56
Correcting error in the interpretation of a criteria
Leafrancia Nov 30, 2022
db666a6
Arranging code according to double codification (first attempt)
Leafrancia Nov 30, 2022
578ed62
Arranging criterion 3
Leafrancia Dec 5, 2022
d599b4a
Clarification of the choice of code used to name the criteria and cod…
Leafrancia Dec 15, 2022
910cf7e
Wraps comment aout `d_crit_123` properly
DaniMori Dec 16, 2022
5286fb4
Put comments in their right place
Leafrancia Dec 16, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@ vignettes/*.pdf
*.docx
*.html
*.dta
*.pdf
378 changes: 378 additions & 0 deletions doc/outcomes/cohorte_2019/ola_1/Description_depression_ICD11.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,378 @@
---
title: "Edad con Salud -- cohort 2019 -- wave 1 -- 'depression_ICD11'"
output:
word_document:
reference_docx: !expr ecs.data::get_pkg_docx_template()
pdf_document: default
csl: "`r ecs.data::get_proj_csl_file()`"
bibliography: "`r ecs.data::get_proj_bib_file()`"
editor_options:
markdown:
wrap: 80
---

```{r setup, include=FALSE}
# Activar los paquetes que R necesita para ejecutar el código:

library(Statamarkdown)

# Ruta al ejecutable de Stata (Ejecuta `sysdir` en Stata para encontrar la ruta)

# Opciones de configuración de las salidas de R y Stata:

knitr::opts_chunk$set( # Para todos los 'chunks' de código:
echo = FALSE, # - No muestra la sintaxis en el documento
results = 'hide',# - Omite los resultados de ejecutar la sintaxis
cleanlog = TRUE, # - Omite repetir sintaxis en resultados de Stata
collectcode = TRUE # - Reutiliza el código de Stata de 'chunks' anteriores
)
```

# Variable information

+---------------------------+------------------+------------+-----------+
| **Main variable name** | **Label** | **Format** | **Code** |
+:==========================+:=================+============+===========+
| depression_lifetime | Lifetime | Binary | - 0=No; |
| | (c2019_w1) | | - 1=Yes |
+---------------------------+------------------+------------+-----------+
| depression_lifetime_proxy | Lifetime | Binary | - 0=No; |
| | depression for | | - 1=Yes |
| | proxy (c2019_w1) | | |
+---------------------------+------------------+------------+-----------+

# Variable description

Depression has become a major public health issue as it is one of the main
causes of disability worldwide, with an even greater impact on developed
countries. According to The ICD-10 Classification of Mental and Behavioural
Disorders, Diagnostic criteria for research
[@world_health_organization_icd-10_1992], the main characteristics of depression
are the presence of a sustained depressed mood, the loss of interest or pleasure
in activities normally pleasurable and/or the decreased energy or increased
fatigability. In addition to these main criteria, the ICD-10 Diagnostic criteria
for research proposes several contributing factors that can be present or
absent: loss of confidence and self-esteem, feelings of self-reproach or guilt,
recurrent thoughts of death or suicide, diminished ability to think or
concentrate, change in psychomotor activity, sleep disturbance, and changes in
appetite with the corresponding weight change. Moreover, the classification
proposes a three-level gradient of severity depending on the amount of criteria
present in each case, from mild to severe. The ICD-11
[@worldhealthorganization2019] refers to the same symptoms but strengthens the
criteria, making the diagnosis of depression more demanding than its
predecessor. In order to address these criteria and be able to assess the
lifetime presence or absence of a depressive episode, as well as its severity,
we used an adapted version of the Composite International Diagnostic Interview
(CIDI 3.0), a comprehensive, fully-structured interview designed to be used by
trained lay interviewers for the assessment of mental disorders according to the
definitions and criteria of ICD-11 (criteria can been seen at [ICD-11 for
Mortality and Morbidity Statistics
(who.int](https://icd.who.int/browse11/l-m/en#/http%3a%2f%2fid.who.int%2ficd%2fentity%2f578635574)[)](https://icd.who.int/browse11/l-m/en#/http%3a%2f%2fid.who.int%2ficd%2fentity%2f1563440232)
It is intended for use in epidemiological and cross-cultural studies, as well as
for clinical and research purposes.
Comment thread
DaniMori marked this conversation as resolved.

# Explanation of how the variables were created

Information from the CIDI depression module was used for the creation of the
depression variables. Algorithms based on the ICD-11 were used for the
endorsement of depressive episode at some point in their lives (lifetime
prevalence; variable `depression_lifetime`). More precisely, the following
criteria must be fulfilled:

Comment thread
DaniMori marked this conversation as resolved.
i) Symptoms should last at least two weeks;

ii) The clinical presentation does not fulfill the diagnostic requirements for a
Mixed Episode;

iii) The episode is not attributable to psychoactive substance use or to any
organic mental disorder

iv) The concurrent presence of at least five of the following symptoms:

- **Affective cluster:** (1) Depressed mood, (2) Markedly diminished
interest or pleasure;
- **Cognitive-behavioural cluster:** (3) Reduced ability to concentrate
and sustain attention, (4) Beliefs of low self-worth or excessive and
inappropriate guilt, (5) Hopelessness about the future, (6) Reccurent
thoughts of death;
- **Neurovegetative cluster:** (7) Significantly disrupted sleep, (8)
Significant change in appetite or weight, (9) Psychomotor agitation or
retardation, (10) Reduce energy, or fatigue;

v) At least one symptom from the affective cluster (depressed mood, loss of
interest).

For reasons of precision and availability of information, certain criteria could
not be taken into account ("The symptoms result in significant distress or
significant impairment in personal, family, social, educational, occupational or
other important areas of functioning." and "Symptoms are not best explained by
bereavement").

The coding of this algorithm is very complex and requires many different
criteria to be taken into account. We have tried to make use of uniform coding
criteria for implementing the computation of the different symptoms and
diagnostic criteria, and also separating clearly the computation of the
*positive*/*negative*/*missing* cases, to make the code the clearest possible.
The following general principles have been followed when possible:

- All the non-valid responses are considered to be *negative* responses; that
is, if an item has been answered with "*Don't know*" (`888`) or "Refused"
(`999`), it is assumed that the criterion is "not met" (=`0`).

- Only the variables that are kept in the final dataset are labelled.

- First, all the cases are set to `.` ("Missing" value).

- Then, the negative cases are recoded to `0` (diagnostic "No").

- Finally, the positive cases are recoded to `1` (diagnostic "Yes").

- Unless stated otherwise, the cases are explicitly recoded to their final
value exclusively and exhaustively, such that the number of cases recoded to
`0`/`1` in each step must be exactly the same as the number of `0`/`1` cases
finally in the variable. This allows for an additional check of recoding
errors.

- When the values need to be compared for unequality (operator `!=`) against a
non-missing value, it must be taken into account that a "missing" value
gives a `1` result instead of a missing in Stata. Therefore, in order to
avoid recoding "missing" values into non-missing ones, the "missing" values
must be excluded from the comparison. This principle is used generally
throughout the algorithm; when used differently, it is explained in the
syntax.

- When these principles are not strictly followed, an annotation is added
right below, explaining how it changes from them and why.

# Syntax used to create the variable (Stata 15)

```{stata load-data}
* Cohorte 2019, ola 1:
use "~\UAM\Marta Miret Garcia - Bases de datos maestras Edad con Salud\Ola_3\Cohorte_2019\rawdata_c2019w1.dta"
```

```{stata generate-outcomes, echo=TRUE}
*# "Value labels (defined for all the outcome variables in the dataset)":
label define yesno 0 "No" 1 "Yes"


***#"VARIABLE `depression_lifetime`: Depressive episode (6A70)"

*#Criterion 1: "The depressive episode should last for at least 2 weeks"
gen d_crit1 = .
replace d_crit1 = 0 if (q4211!=1 & q4211!=.) | (q4213!=1 & q4213!=.)
replace d_crit1 = 1 if q4211==1 | q4213==1

*#Criterion 2: "The clinical presentation does not fulfil the diagnostic
*# requirements for a Mixed Episode"
gen d_crit2 = .
replace d_crit2 = 0 if (q4233==1 & proxy==2) | q4225_causemed2==1
replace d_crit2 = 1 if (q4233!=1 & q4233!=. & proxy==2) | q4225_causemed2!=1
*#"NOTE: When `q4225_causemed2` is not selected, its value may be `0` or
*# 'missing', so only `q4233` is considered to determine whether
*# this criterion is 'missing'".

*#Criterion 3: "The episode is not attributable to psychoactive substance use or
*# to any organic mental disorder"
gen d_crit3 = .
Comment thread
DaniMori marked this conversation as resolved.
replace d_crit3 = 0 if q4224b==1 | (q4224==1 & (q4225_causemed12==1 | q4225_causemed23==1 | q4225_causemed24==1 | q4225_causemed25==1 | q4225_causemed30==1 | q4225_causemed31==1))
replace d_crit3 = 1 if (q4224a!=1 & q4224a!=.) | (q4224b!=1 & q4224b!=.) | (q4224==1 & (q4225_causemed12!=1 & q4225_causemed23!=1 & q4225_causemed24!=1 & q4225_causemed25!=1 & q4225_causemed30!=1 & q4225_causemed31!=1))
*#"NOTE: When `q4224b==1` it is necessarily the case that `q4224a==1`,
*# so only `q4224b` out of these two needs to be checked for considering
*# the criterion negative."


*#Filling of the three first criteria above (Criterion 1, 2 and 3):
gen d_crit_123 = .
replace d_crit_123 = 0 if d_crit1==0 | d_crit2==0 | d_crit3==0
replace d_crit_123 = 1 if d_crit1==1 & d_crit2==1 & d_crit3==1
Comment thread
DaniMori marked this conversation as resolved.


*#Criterion 4: "A total of at least five symptoms from the following list should
*# be present."

*# AFFECTIVE CLUSTER:

*#S1: "Depressed mood to a degree that is definitely abnormal for the
*# individual, present for most of the day and almost every day, largely
*# uninfluenced by circumstances, and sustained for at least 2 weeks"
gen d_s1 = .
replace d_s1 = 0 if (q4220a!=1 & q4220a!=.) & q4220b!=1 & q4220c!=1
replace d_s1 = 1 if q4220a==1 | q4220b==1 | q4220c==1
*#"NOTE: When `q4220b` or `q4220d` are "missing" it may be due to the interview
*# skip logic in `q4220a` or `q4220c`, respectively. But if there is a
*# response in`q4220a` there must be one also in `q4220c`. Therefore, only
*# `q4220a` needs to be checked for missingness".

*#S2: "Loss of interest or pleasure in activities that are normally pleasurable
*# (including sexual desire)"
gen d_s2 = .
replace d_s2 = 0 if (q4220e!=1 & q4220e!=.) & q4220f!=1
replace d_s2 = 1 if q4220e==1 | q4220f==1

*# COGNITIVE-BEHAVIOURAL CLUSTER:

*#S3: "Complaints or evidence of diminished ability to think or concentrate,
*# such as indecisiveness or vacillation"
gen d_s3 = .
replace d_s3 = 0 if q4222h!=1 & q4222h!=. & q4222i!=1 & q4222j!=1
replace d_s3 = 1 if q4222h==1 | q4222i==1 | q4222j==1
*#"NOTE: When `q4222i` and `q4222j` are 'missing' it may be due to the
*# interview skip logic in `q4222h`. Therefore, only `q4222h` needs
*# to be checked for missingness".

*#S4: "Beliefs of low self-worth or excessive and inappropriate guilt that may
*# be manifestly delusional"
gen d_s4 = .
replace d_s4 = 0 if ((q4222k!=1 & q4222k!=.) & (q4222l!=1 & q4222l!=.) & q4222m!=1) | (q4222n!=1 & q4222n!=.)
replace d_s4 = 1 if q4222k==1 | q4222l==1 | q4222m==1 | q4222n==1
*#"NOTE: When `q4222m` is "missing" it may be due to the interview
*# skip logic in `q4222l`. Therefore, only `q4222k` and `q4222l`
*# need to be checked for missingness".

*#S5: "Hopelessness about the future."
gen d_s5 = .
replace d_s5 = 0 if q4220d!=1 & q4220d!=.
replace d_s5 = 1 if q4220d==1
*#"NOTE: Symptom presents in the ICD10 as, (d) bleak and pessimistic views of
*# the future;"

*#S6: "Recurrent thoughts of death or suicide, or any suicidal behaviour"
gen d_s6 = .
replace d_s6 = 0 if q4222r!=1 & q4222r!=. & q4222s!=1 & q4222t!=1 & q4222u!=1 & q4222v!=1
replace d_s6 = 1 if q4222r==1 | q4222s==1 | q4222t==1 | q4222u==1 | q4222v==1
*#"NOTE: When any of the two last items are 'missing' it may be due to
*# the interview skip logic in `q4222t`. But if there is a
*# response in `q4222r` there must be one also in `q4222s` and
*# `q4222t`.Therefore, only `q4222r` needs to be checked for
*# missingness".

*# NEUROVEGETATIVE CLUSTER:

*#S7: "Sleep disturbance of any type"
gen d_s7 = .
replace d_s7 = 0 if (q4222c!=1 & q4222c!=.) & q4222d!=1
replace d_s7 = 1 if q4222c==1 | q4222d==1
*#"NOTE: When `q4222d` is 'missing' it may be due to the interview skip
*# logic in `q4222c`. Therefore, only `q4222c` is checked for
*# missingness".

*#S8: "Change in appetite (decrease or increase) with corresponding weight
*# change"
gen d_s8 = .
replace d_s8 = 0 if (q4222a!=1 & q4222a!=.) | (q4222b!=1 & q4222b!=.)
replace d_s8 = 1 if q4222a==1 & q4222b==1

*#S9: "Change in psychomotor activity, with agitation or retardation (either
*# subjective or objective)"
gen d_s9 = .
replace d_s9 = 0 if (q4222f!=1 & q4222f!=. & q4222fa!=1) | (q4222g!=1 & q4222ga!=1 & q4222g!=.)
replace d_s9 = 1 if q4222f==1 | q4222fa==1 | q4222g==1 | q4222ga==1
*#"NOTE: When the three last items are 'missing' it may be due to the
*# interview skip logic in `q4222f`. Therefore, only `q4222f` needs
*# to be checked for missingness".

*#S10: "Decreased energy or increased fatigability"
gen d_s10 = .
replace d_s10 = 0 if q4222e!=1 & q4222e!=.
replace d_s10 = 1 if q4222e==1

*#"Sum of depressive symptoms"
egen d_symptot = rowtotal (d_s1 d_s2 d_s3 d_s4 d_s5 d_s6 d_s7 d_s8 d_s9 d_s10), missing

*#"To fulfill Criterion 4, at least five symptoms should be present".
gen d_crit_5 = .
replace d_crit_5 = 0 if d_symptot <4
replace d_crit_5 = 1 if d_symptot>=4 & d_symptot!=.


*#Criterion 5: "At least one symptom from the affective cluster must be present"

*#"Sum of depressive symptoms of affective cluster"
egen d_afftotal = rowtotal (d_s1 d_s2), missing

*#"To fulfil criterion 4 at least one symptoms of the affective cluster should
*# be present".
gen d_crit_4 = .
replace d_crit_4 = 0 if d_afftotal <1
replace d_crit_4 = 1 if d_afftotal==1 | d_afftotal==2


***#"Has the person skipped the lifetime depression module?"

*#"Depression symptoms recoded into 0/1 to compute the tally":
recode q4220a-q4222v (1=1) (2=0) (888 999=.)

*#"Filter variables":
gen f4217 = q4214==1 & q4215==4 & q4216==4 if q4214!=.
egen f4221_sum = rowtotal (q4220a-q4220f), missing
egen f4223_sum = rowtotal (q4220a-q4222v), missing

*#"Variable "skipped" computation":
gen d_skipped = .
replace d_skipped = q4202!=1 if q4202!=.
replace d_skipped = q4211!=1 | d_skipped==1 if q4211!=.
replace d_skipped = q4213!=1 | d_skipped==1 if q4213!=.
replace d_skipped = q4218!=1 | d_skipped==1 if q4218!=.
replace d_skipped = f4217==1 | d_skipped==1 if f4217!=.
replace d_skipped = f4221_sum<1 | d_skipped==1 if f4221_sum!=.
replace d_skipped = f4223_sum<2 | d_skipped==1 if f4223_sum!=.
*#"NOTE: For clarity, this recoding adds the criteria incrementally. This
*# implies that the new "truth values" (0/1 resulting from each
*# comparison) are "logically added" (therefore the "OR" operation)
*# to the current values".


***#"Lifetime depression diagnostic variable":
gen depression_lifetime = .
replace depression_lifetime = 0 if d_skipped==1 | d_crit_123==0 | d_crit_4==0 | d_crit_5==0
replace depression_lifetime = 1 if d_skipped==0 & d_crit_123==1 & d_crit_4==1 & d_crit_5==1
label values depression_lifetime yesno
label variable depression_lifetime "Lifetime depression (c2019_w1)"


***#"VARIABLE `depression_lifetime_proxy`: Depressive episode for proxy participants"
recode P4040 (1=1) (2=0) (888=0) (999=0), gen (depression_lifetime_proxy)
label values depression_lifetime_proxy yesno
label variable depression_lifetime_proxy "Lifetime depression for proxy (c2019_w1)"

```

<br>

```{stata descriptives, collectcode=FALSE, results='markup'}
codebook depression_lifetime depression_lifetime_proxy
```

```{stata save-data}
keep q0007a_result ID_ECS proxy subsample_pre interview_pre depression_lifetime depression_lifetime_proxy

* Cohorte 2019, ola 1:

saveold "~\UAM\Marta Miret Garcia - Documentacion Edad con Salud\Edad con salud - Ola 3\Outcomes\Cohorte 2019\Outcome datasets\Outcome_depression_ICD11.dta", replace version(13)
```

# Contact person:

- Name: Lea Francia (UAM)
- e-mail: [lea.francia\@inv.uam.es](mailto:lea.francia@inv.uam.es){.email}

Original version:

- Name: Daniel Morillo (UAM)
- e-mail:
[daniel.morillo\@inv.uam.es](mailto:daniel.morillo@inv.uam.es){.email}
- Phone number: (+34) 914975816

# References

::: {#refs}
:::

\newpage

# Session info

```{r, results='markup'}
devtools::session_info()
```
9 changes: 9 additions & 0 deletions www/Edad_con_salud_outcome_vars.bib
Original file line number Diff line number Diff line change
Expand Up @@ -270,3 +270,12 @@ @techreport{world_health_organization_icd-10_1992
note = {ISBN: 9787117019576
number-of-pages: 362},
}

@book{worldhealthorganization2019,
title = {International Statistical Classification of Diseases and Related Health Problems (11th ed.)},
author = {World Health Organization, },
year = {2019},
date = {2019},
edition = {11},
url = {https://icd.who.int/}
}