3

I'm using MatchIt to match based on propensity score and then I'm checking the standardized difference. I tried to manually calculate the standardized difference for some of my matching variables and I'm not getting the same results as the output of the model.

#run the model 
ps<-matchit(y ~ ., data=mydata, method = "nearest", distance = "logit")
#store the results as a data frame 
comp <- as.data.frame(summary(ps, standardize = TRUE)["sum.matched"])
#print the results 
comp[, "sum.matched.Std..Mean.Diff." , drop=FALSE]

My question here is: Does anyone know the formula to manually calculate the standardized differences that is used in the matchIt package? I'm interested in the formula for standardized difference in means and in proportions (are they different? Maybe that's why)

user2592729
  • 429
  • 5
  • 16
  • Asking for a formula really isn't a specific programming question. If you want more information about statistical models or methods, you're better off asking at [stats.se]. If you want to know exactly what this function does, check out [how to find the source code for an R function](http://stackoverflow.com/questions/19226816/how-can-i-view-the-source-code-for-a-function) – MrFlick Mar 25 '15 at 02:25
  • Im having a hard time reading the source code for that function. That's what I needed help with. Will edit to highlight that. – user2592729 Mar 25 '15 at 03:05

2 Answers2

1

I have the same problem and I think the formula that MatchIt uses is different than the most commonly used one.

According to Ho et al.'s article (http://imai.princeton.edu/research/files/matchit.pdf) "the standardize = TRUE option will print out standardized versions of the balance measures, where the mean difference is standardized (divided) by the standard deviation in the original treated group."

So the denominator in the package's formula should be s(treated), instead of the square root of s(treated)^2+s(control)^2.

Aslı Gürer
  • 39
  • 1
  • 9
0

I used below formulas as per the variables types in my data: using stddiff package.

SD1<- stddiff.numeric(data = Edrees, gcol = 1, vcol = ,2:4)
SD2<- stddiff.binary(data= Edrees, gcol = 1 , vcol = 6)
SD3<- stddiff.category(data = Edrees, gcol = 1, vcol = 7)
Stephen Rauch
  • 47,830
  • 31
  • 106
  • 135