Git Product home page Git Product logo

calculo_indicators_r's Introduction

SCL Data - Data Ecosystem Working Group

IDB Logo

Welcome to IDB Social Indicators

This repository aims to provide a framework for computing social sector indicators in a clean, organized and repeatable manner.

Getting Started

To start contributing, first clone this repository. Then, we primarily work with two branches: 1) main and 2) development.

The development branch is the most current one. When contributing, pull from this branch and create a new personal branch for the specific task you are working on. For instance, if you are reviewing geographical disaggregations, create a branch named "geographic_dis_scl".

Work on the assigned tasks, commit and push the changes to the development branch. Make a pull request so that another team member can review it and accept it as the new version of development.

Calculating indicators

To calculate indicators, create the folder Outputs and then there are two ways to calculate indicators depending on the amount of countries and years required:

  1. Specific country, source of information and year: Open the runningScript.R, and modify the variables pais, year, type and geoLevel after which execute the code runningScript.R.

    • pais: To specify this use the ISO Alpha-3 code for the specific country (e.g. SLV for El Salvador).
    • year: Specify as a string the required year for the indicator
    • tipo: Specify one of the two:"censos" or "encuestas" as strings depending if census or surveys are required.
    • geoLevel1: For census, specify if the indicators to calculate will be disagregated at a country level or first geographical disagreggation.
  2. Loop through different countries and years: Open the runningScript.R and define the variable tipo with "encuestas" or "censos" depending on the data source type required. Then execute the code runningScript_loop.R and indicators will be calculated based on all the census or surveys available according to the Inputs/running_survey.csv or Inputs/running_census.csv files.

Repository Structure

This repository consists of three main parts.

  1. Intermediate Variables: One script per division, each containing all necessary variables for computing the indicators of the corresponding division (var_EDU.R, var_GDI.R, var_LMK.R and var_SOC.R)

  2. Indicator Definitions (idef.csv): This file controls the computation of indicators. It contains the definition of each indicator.

  3. Running Scripts: runningScript.R runs the function in scl_indicators.R. runningScript_loop.R runs scl_indicators.R for a batch of countries

  4. Functions: These scripts stablish the functions required to calculate indicators.

    • functions.R: contains the functions to calculate indicators for ratios (scl_pct), means (scl_mean) and gini (scl_gini). As well as a function to execute all indicators in idef.csv (calculate_indicators) and a function to delimit the disagregations to execute (evaluatingFilter).
    • directory_periods.R: This scrips based on the type of data source survey (encuesta) or census(censos) defined in variable tipo returns the appropiate harmonized.
  5. Inputs folder This folder includes important supporting documents such as excels showing the data available (Planeación - Armonización de Encuestas de Hogares.xlsx, Planeación - Population and Housing Censuses.xlsx, running_census.csv and running_survey.csv), dictionary of variable for both census and surveys (D.1.1.4 Diccionario microdatos encuestas de hogares.xlsx and D.7.1.3 Diccionario variables censos.xlsx) and identification files (idef.csv and idefCensos.csv) defining the indicators to calculate.

How to Contribute

  1. Fork the repository to your GitHub account.

  2. Clone the forked repository to your local machine.

  3. Create a new branch for your tasks.

  4. Make your changes and commit them to your branch.

  5. Push the branch to your GitHub repository.

  6. From the GitHub page of your forked repository, open a pull request to the development branch of the main repository.

calculo_indicators_r's People

Contributors

davidcornejoarias avatar mariarrt94 avatar cgiam avatar linarias8 avatar

Watchers

Antonio Vazquez Brust avatar Código para el Desarrollo avatar Luis Tejerina avatar

Forkers

rdsantos3 el-bid

calculo_indicators_r's Issues

Add strata/UPM

David está revisando como se hace esto con la libraría survey de R

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.