Git Product home page Git Product logo

cmix_wrapup's Introduction

Code for the analyses of the last CoMix data.

Results from this analysis are presented in the manuscript "Social contact patterns following the COVID-19 pandemic: a snapshot of post-pandemic behaviour from the CoMix study" available on MedrXiv.

Repository organization

The repository is organized in the following folders:

  • data: Folder that contains the datasets.
  • r: Folder with the main code.
  • stan: Folder with Stan related functions.
  • output: Folder where the output of the analysis (tables and figures of the manuscript) is saved.

Data

The data analysed in the manuscript is available in the folder data/zenodo, together with the corresponding dictionary (CoMix_last_wave_dictionary.xlsx). The dataset is also available independently on Zenodo at the following link. The data is formatted according to the standard of the socialcontactdata.org initiative and is therefore interoperable with the socialmixr R package. The participant information is reported (one participant per line) in the files participants_common and participants_extra, while the contacts information are reported (one contact per line) in the contacts_common and contacts_extra files.

Analysis

To perform the analysis:

  • Update the "r/00_setup_filepaths.R" file to include the working path of the local machine.
  • Run the "r/master.R" file. The code relies on specific implementa

Output

The code generates as output the three tables of the main paper:

  • Table 1 ("tab1_characteristics.docx"): Participants characteristics. The code generates a table of the participants features, listing both absolute numbers and percentages. To compute correctly the percentages the custom funcion get_perc is used.
  • Table 2 ("tab2_contacts.docx"): Mean daily contacts per participant by country and setting, together with bootstrap confidence intervals.
  • Table 3 ("tab3_contacts.docx"): Mean daily contacts per participant by characteristics, together with bootstrap confidence intervals.

And figure 1,2 and 3 of the main paper. In particular, the code to plot the contact matrices can be found in an_fig3_cms.R and could be adapted to explore the data.

We refer to the manuscript for the interpretation of the results.

Required packages:

  • data.table
  • lubridate
  • flextable
  • magrittr
  • dplyr
  • socialmixr
  • ggplot2
  • patchwork
  • forcats
  • gtsummary
  • boot
  • wpp2022
  • viridis
  • cowplot
  • tidyverse
  • stringr
  • readxl
  • reshape2

cmix_wrapup's People

Contributors

jarvisc1 avatar ptrcol 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.