Open data and code
Anonymised data from a descriptive study of sleep-disorder prevalence using the Oviedo Sleep Questionnaire (COS), administered on 14 September 2026 to Biological Sciences students: 58 questionnaires, 57 valid. The diagnostic criteria are those of García-Portilla and colleagues (2009, appendix 2). With these files, the analysis reproduces the report's figures exactly.
The files
| File | What it is |
|---|---|
cos_publico.csv | The anonymised data: one row per questionnaire (N = 57), with items, scores, diagnoses and coding notes. |
cos_publico.json | The same data, in JSON. |
analisis_cos.py | The full analysis: applies the COS diagnostic rules, computes the prevalences with their 95% confidence interval (Wilson method) and, with --figuras, draws the report's figures. |
figuras_cos.py | Draws the three figures; called by analisis_cos.py. |
figuras/figura1_puntos.png | One dot per student, with the ICD-10 rule and the DSM-IV rule. |
figuras/figuraA1_flujo.png | How the sheets became results. |
figuras/figuraA2_intervalos.png | Each prevalence with its confidence interval. |
anexos_cos.py | Builds the appendix D tabulation matrix with the same rules. |
anexo_matriz_tabulacion.csv | The tabulation matrix produced by anexos_cos.py. |
preparar_datos_publicos.py | How the public version was produced from the raw data. |
demo_cos.py | Classroom demo: the prevalence under each diagnostic criterion. |
demo_umbral.py | Classroom demo: the threshold decides the figure; recomputes the data under different criteria. |
demo_aula.py | The same demo, told for projecting in class, one figure at a time. |
slider_ventana.py | The threshold with a slider, in a window. |
slider_consola.py | The threshold with a slider, drawn in the console. |
prueba_entorno.py | Checks that the Python environment has what the demos need. |
How to reproduce the figures
Download cos_publico.csv, analisis_cos.py and figuras_cos.py into the same folder and, from there:
python -m pip install statsmodels matplotlib
python analisis_cos.py cos_publico.csv --figuras
What is not here
The raw data are not published: they contain participants' free text and the codes each of them could use to ask for their results. preparar_datos_publicos.py shows how the public version was produced: it removes the free text, reassigns the codes at random and checks that the prevalences match the report before writing anything.
License
Data and code are released under CC BY 4.0: you may use, modify and redistribute them with attribution («Carlos Eduardo Ravello Joo, Researching Mind») and a link to this page. A figure nobody can check is not data.