cem icon indicating copy to clipboard operation
cem copied to clipboard

Question about different results for L1 imbalance measure in R and Stata

Open Katzi90 opened this issue 2 years ago • 1 comments

I am trying to replicate a cem matching from Stata in R. As a first step I want to evaluate the imbalance. In R I used the following code:

vars <- c("X1PLTOT", "X1EBRSTOT",  "X1MTHETK2", "X1RTHETK2", "X1DCCSTOT", "X1NRWABL", "female", "latino", "white", "asian", "other", "rural", "ses")
imb <- imbalance(group=cem$elprgm, data = cem[vars])
View(imb$tab)

In Stata I used: global treat elprgm imb X1PLTOT X1EBRSTOT X1MTHETK2 X1RTHETK2 X1DCCSTOT X1NRWABL female latino white asian other rural ses , treatment($treat)

I used the same dataset in R and stata. For my imbalance results mean differences are the same (just once negative and once positive) while the L1 values differ for four of my variables: X1MTHETK2, X1RTHETK2, X1NRWABL, ses

I do not understand why there are differences for these four variables whereas results are similiar for the rest of my variables. Do you have any idea what the problem might be?

Imbalance_Stata Imbalance_R

Katzi90 avatar Nov 15 '22 09:11 Katzi90