MPI_demo"

Simple Simulation

library(MPI)
library(kableExtra) 

Loading Data

MPI::examplePovertydf is a simulation poverty data frame contains 16 indicators column which 1 means deprived and 0 means not deprived, and simulated forth-level administrative division of France.

data(examplePovertydf)
kable(head(examplePovertydf, n = 3), 
      "html", 
      col.names = gsub("[.]", " ", names(examplePovertydf))) %>% 
  kable_styling()

Calculation

For calculating MPI using AF_Seq for sequential run or AF_Par for parallel run.

Input will be

out_seq <- AF_Seq(examplePovertydf, g = "Region", k = 3)

Output will be list of lists separated into group, and each list contains

out_seq[[1]]$groupname
out_seq[[1]]$total
out_seq[[1]]$poors
out_seq[[1]]$H
out_seq[[1]]$A
out_seq[[1]]$M0
kable(out_seq[[1]]$DimentionalContribution, 
            "html",
            col.names = gsub("[.]", " ", names(out_seq[[1]]$DimentionalContribution))) %>%
  kable_styling()
kable(out_seq[[1]]$pov_df, 
            "html",
            col.names = gsub("[.]", " ", names(out_seq[[1]]$pov_df))) %>%
  kable_styling()


Try the MPI package in your browser

Any scripts or data that you put into this service are public.

MPI documentation built on April 5, 2022, 5:06 p.m.