Coder Social home page Coder Social logo

brazil-mortality-release's Introduction

title output
Brazil mortality replication code
html_document

Brazil sibling/network mortality analysis

Replication using Docker

It is likely that you have different versions of R and specific R packages than we did when we wrote our code. Thus, we recommend using Docker to replicate our results. Using Docker will ensure that you have exactly the same computing environment that we did when we conducted our analyses.

To use Docker

  1. Install Docker Desktop (if you don't already have it)

  2. Clone this repository

  3. Be sure that your current working directory is the one that you downloaded the repository into. It's probably called brazil-mortality-release/

  4. If you are using a recent Mac (with Apple silicon), then you might need to type export DOCKER_DEFAULT_PLATFORM=linux/amd64

  5. Build the docker image. docker build --rm -t brazil-replication . This step will likely take a little time, as Docker builds your image (including installing various R packages)

  6. Run the docker image docker run -d --rm -p 8888:8787 -e PASSWORD=pass --name brazil brazil-replication OR, to mount a local drive, you will need something like:

    docker run -d --rm -p 8888:8787 -e PASSWORD=pass --name brazil -v $(pwd):/home/rstudio/ brazil-replication

  7. Open a web browser and point it to localhost:8888

  8. Log onto Rstudio with username 'rstudio' and password 'pass'

  9. Open the file brazil-mortality-release/code/00_run_all.r

  10. Running the file should download the data and replicate everything.

Files

This directory contains the files that produce estimates from the sibling and network methods, and then compares those estimates to the vital registration data.

It is organized into subdirectories:

  • code - has R scripts
    • 00_run_all.R - a script that downloads the data and runs everything
    • 00_sample_map.Rmd - create the map showing the cities in our sample
    • 01_vr_completeness.Rmd - summarize estimated VR completeness by city
    • 02_get_vr_estimates.Rmd - calculate VR death rates for each city and region
    • 03_network_estimates.Rmd - calculate network estimates
    • 04_sibling_estimates.Rmd - calculate sibling estimates
    • 05_run_comparison.Rmd - run comparisons between estimates and the vital registration
    • 06_plots.Rmd - make several plots
    • 99_vr_comparison.Rmd - has the code that compares estimates to VR; only to be run by 00_run_all.R
  • data - has the data used in the analysis; this will be downloaded by 00_run_all.R
    • cities.csv - data on the cities in our study
    • ibge-capture-recapture - results from IBGE's capture-recapture study
    • survey - data from the survey
      • bootstrap_weights_1k.csv - bootstrap resampling weights that account for our survey's complex sample design
      • individual.csv - data on the respondents to the survey
      • network_reports.csv - data on deaths reported in the network part of the survey (one row per reported death)
      • sibling_reports.csv - data on siblings reported in the sibling module (one row per reported sib)
    • vr - raw vital registration data
      • deaths - data on deaths
      • popn - data on popn size
    • vr_prepped - VR data after being prepared for comparison (created by script)

A small part of our results are not produced by the code included here, because they depend on data that we cannot release (because they have identifiers). These results include:

  • The response rates presented in Table S2
  • The numbers shown in Figure S2
  • The numbers shown in Figure S3

brazil-mortality-release's People

Contributors

dfeehan 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.