Code Monkey home page Code Monkey logo

early-life-mh-sleep's Introduction

Associations between early-life mental health and abnormal sleep duration in midlife: findings from a prospective cohort study in Great Britain

This repository contains the supplementary data for the paper "Associations between early-life mental health and abnormal sleep duration in midlife: findings from a prospective cohort study in Great Britain" (preprint available at https://doi.org/10.1101/2023.12.13.23299897).

Please review the licensing information at LICENCE.md and THIRDPARTY.md before reusing any software in this repository.

1. Introduction

There are a number of steps to the analysis. The underlying raw data are available free of charge as follows:

Check the code for the file structure used to store the raw data, or you can store the data elsewhere and change the filepaths present in the code.

2. Deriving sleep durations from accelerometry

These R markdown (.Rmd) scripts were rendered separately and do not use the renv environment present in the repository. Use R version 4.2.0.

3. Cleaning survey data, incorporating sleep estimates and performing regressions

These steps use the targets framework and renv environment present in the repository. After producing or acquiring the derived sleep estimates, you can run these steps by running targets::tar_make() in R 4.2.0 inside the repository. The mice_report and models_report Quarto files are rendered automatically as part of the {targets} pipeline, and the output .html files are also provided in the repository.

4. Plots

Because of technological limitations, the plots must be rendered separately after the completion of the cleaning and analysis steps by rendering the Quarto file 4_plots.Qmd. Use R version 4.2.0 and the renv environment present in the repository. The output .html file and the plot .svg and .png files are also provided in the repository.

5. Supplementary information

The data tables listed in the supplementary information can be accessed by rendering the Quarto file 5_supplementary_info.Qmd. Use R version 4.2.0 and the renv environment present in the repository. The output .html file is also provided in the repository.

Accessing additional raw model outputs

Once you have completed step 3, you can access all raw model outputs, intermediate datasets and summaries using the targets::tar_read() function. For more details, see the {targets} package documentation.

early-life-mh-sleep's People

Contributors

tom-metherell avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.