Hi,
I'm using MachIt. After matching, I'd like to analyse the new dataset with a simple multilevel model with weights produce by some mathing methods AND I want the p-values for fixed effects. But I have a problem.
I tried to use both lme() and lmer() functions.
The lme() weights argument don't seem appropriate or I don't know how to use it. The argument ask for a varFunc object. Just putting the weights variable doesn't work !
The weights argument of lmer() function works well but it doesn't gives me the p-values for fixed effects !
Is their a way to use either lme() OR lmer() and to be able to use weights variable and have access of p-values at the same time?
Thanks,
François Maurice
Hi Dear Dr. Imai,
I am trying to write a R function of ATT caclulation with Zelig for post matching analysis after using matchit for matching in propensity score analysis.
ATT caclulation didn't work out when I put them into the function, and I couldn' find out what's wrong with it.
Would you please help me out with this problem? I really appreciate that.
The following is my code.
###########################
library(twang)
data(lalonde)
m.out1 <- matchit(treat ~ age + educ + black + hispan + nodegree + married + re74 + re75, method = "nearest", data = lalonde)
match.a=match.data(m.out1)
match.c=match.data(m.out1, "control")
match.t=match.data(m.out1, "treat")
PM.ATT <-
function(formula)
{ # Average treatment effect on the treated (ATT)
# We do this by estimating the coeffcients
# in the control group alone
z.out1 <- zelig(formula, data = match.c , model = "ls")
x.out1 <- setx(z.out1, data = match.t,cond = TRUE)
s.out1 <- sim(z.out1, x = x.out1)
ATT <- summary(s.out1)
return(ATT)
}
PM.ATT(re78 ~ age + educ + black + hispan + nodegree + married + re74 + re75)
#######################################
Thanks and best regards,
Meijing WU
PHD student
Dept. of health statistics
second military medical university
shanghai, china
Question, MatchIt
I am currently using the package MatchIt. However, given the design of
the study, the distance we used was based on Cox models instead of
logistic model. We thus created a distance matrix with the treated in
rows and the controls in column. To perform the matching, we currently
use the package Optmatch [we feed the matrix to fullmatch()]. However,
MatchIt is very user friendly and its combination with Zelig is also
very useful. So I wonder I could feed my distance matrix to matchit()
instead of using a call like: treat~x1+x2.
Many thanks !
Jean-Baptiste