In a previous blog I posted the R functions to decompose Gini coefficients based on a weighted average of pseudo-Gini (Fei et al 1978; Shorrocks 1982). Another way to decompose inequality is a regression-based approach proposed by Morduch and Sicular (2002) following the logic of Shorrock's theorem in his classic 1982 paper.
decomp <- function(M) {
n <- length(M$coefficients)
cov <- cov(M$model[,1],M$model)
var <- cov[1]
cof <- M$coefficients
share <- cov[2:n]*cof[2:n]/cov[1]
decomp <- rbind(cov[2:n],cof[2:n],var,share)
rownames(decomp) <- c("covariance","coefficient",
"variance","contribution")
decomp
}
2. An example in R results:
No comments:
Post a Comment