You should create a dataframe and then feed that into matchit(). Right
now, you are feeding X which is a matrix and then specifying another data
frame in "data = ". Use the standard formula syntax; y ~ x1 + x2 etc.
That is, follow closely the examples given in the matchit document.
Good luck,
Kosuke
--
Department of Politics
Princeton University
http://imai.princeton.edu
On Thu, 16 Jul 2009, Prashant wrote:
Hi,
I'm trying to run matchit followed by zelig to calculate the ATT:
After running z.out <- zelig(@@@), I get the following error message:
Error in `[.data.frame`(d, , all.vars(as.expression(formula))) :
undefined columns selected
I'm not sure why I'm getting this error message--afterwards, I want to run:
x.out1 <- setx(z.out1, data = match.data(m.outf, "treat"), cond = TRUE)
s.out1 <- sim(z.out1, x = x.out1)
Any help at all would be most appreciated!
best,
Prashant
P.S. Specifically, I had run the following code:
ps <- glm(Tr ~ female + urban + father_edu + mother_edu + siblings +
hs_type_best + kuaiban + wangjie + sx_non_mil12 + I(age^2) + I(urban*age) +
I(urban*mother_edu) + I(urban*sx_non_mil12) + I(female*sx_non_mil12) +
I(urban*wangjie) + I(female*wangjie), family=binomial, data=my.data)
X = cbind(age, female, urban, father_edu, mother_edu, siblings,
hs_type_best, kuaiban, wangjie, sx_non_mil12, I(age^2), I(urban*age),
I(urban*mother_edu), I(urban*sx_non_mil12), I(female*sx_non_mil12),
I(urban*wangjie), I(female*wangjie), ps$fitted)
m.outf <- matchit(Tr ~ X, data = rdmatchAC.lk12.range10, method =
"genetic",
ratio = 2, replace = TRUE, pop.size=1000, discard = "control")
z.out1 <- zelig(Y1 ~ Tr + X + gk_score, model = "ls", data =
match.data(m.outf, "control"))
x.out1 <- setx(z.out1, data = match.data(m.outf, "treat"), cond = TRUE)
s.out1 <- sim(z.out1, x = x.out1)
-
Zelig Mailing List, served by Harvard-MIT Data Center
Send messages: zelig(a)lists.gking.harvard.edu
[un]subscribe Options:
http://lists.gking.harvard.edu/?info=zelig
Zelig program information:
http://gking.harvard.edu/zelig/