Researching Mind

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

FileWhat it is
cos_publico.csvThe anonymised data: one row per questionnaire (N = 57), with items, scores, diagnoses and coding notes.
cos_publico.jsonThe same data, in JSON.
analisis_cos.pyThe 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.pyDraws the three figures; called by analisis_cos.py.
figuras/figura1_puntos.pngOne dot per student, with the ICD-10 rule and the DSM-IV rule.
figuras/figuraA1_flujo.pngHow the sheets became results.
figuras/figuraA2_intervalos.pngEach prevalence with its confidence interval.
anexos_cos.pyBuilds the appendix D tabulation matrix with the same rules.
anexo_matriz_tabulacion.csvThe tabulation matrix produced by anexos_cos.py.
preparar_datos_publicos.pyHow the public version was produced from the raw data.
demo_cos.pyClassroom demo: the prevalence under each diagnostic criterion.
demo_umbral.pyClassroom demo: the threshold decides the figure; recomputes the data under different criteria.
demo_aula.pyThe same demo, told for projecting in class, one figure at a time.
slider_ventana.pyThe threshold with a slider, in a window.
slider_consola.pyThe threshold with a slider, drawn in the console.
prueba_entorno.pyChecks 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.