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)
>
--
MatchIt mailing list served by Harvard-MIT Data Center
List Address: matchit(a)lists.gking.harvard.edu
Subscribe/Unsubscribe: http://lists.gking.harvard.edu/?info=matchit
MatchIt Software and Documentation: http://gking.harvard.edu/matchit/
Browse/Search List Archive: http://lists.hmdc.harvard.edu/lists/matchit/
Hi,
Thanks for the input on survey weights, it was very helpful. What I still don't understand is how to turn MatchIt output into a single value for ATT. I re-read the manual and showed it to several experienced quantitative research faculty at my university over this past week, but nobody could even remotely figure out how to interpret the output that MatchIt produces.
I understand the concept behind ATT but am having trouble with the correct practical application. Could someone please provide the specific formulas and steps needed to convert MatchIt output for ATT (as provided in an example below) into an actual ATT value?
Sorry if this is a mundane request but since even seasoned faculty couldn't help me out there might be a broader need for a basic stepwise tutorial for turning MatchIt output into a single value for ATT. This way, less experienced researchers like myself could take better advantage of this great piece of software.
Many thanks in advance,
Sinan
MatchIt ATT output example:
Mean Values of Observed Data (n = 264)
(Intercept)=1.0000 sex=1.4470 race=4.6780 fcomp=1.6515 ses=-0.1496 lang=0.8333 prog=1.8409 urban=1.8788 control=1.2197 math=46.7506 reading=46.1787 expect=4.4356 atw=11.1742
Pooled Expected Values: E(Y|X)
mean sd 2.5% 97.5%
3.9676 0.5416 2.9361 5.0558
Pooled Average Treatment Effect for the Treated: Y - EV
mean sd 2.5% 97.5%
0.26723 0.07029 0.12872 0.39879
--
MatchIt mailing list served by Harvard-MIT Data Center
List Address: matchit(a)lists.gking.harvard.edu
Subscribe/Unsubscribe: http://lists.gking.harvard.edu/?info=matchit
MatchIt Software and Documentation: http://gking.harvard.edu/matchit/
Browse/Search List Archive: http://lists.hmdc.harvard.edu/lists/matchit/
Hi there,
In my previous posting about using survey weights I referred to log-linear analysis as a parametric test, which was of course wrong - I shouldn't be working on a Saturday night :)
Anyway, I've just started to teach myself about PSM and have a question about my output for ATT:
Mean Values of Observed Data (n = 264)
Pooled Expected Values: E(Y|X)
mean sd 2.5% 97.5%
3.9676 0.5416 2.9361 5.0558
Pooled Average Treatment Effect for the Treated: Y - EV
mean sd 2.5% 97.5%
0.26723 0.07029 0.12872 0.39879
How do I turn this output into a value for ATT? Does this basically boil down to a t-test? I know this is really basic but I don't understand.
~Sinan
--
MatchIt mailing list served by Harvard-MIT Data Center
List Address: matchit(a)lists.gking.harvard.edu
Subscribe/Unsubscribe: http://lists.gking.harvard.edu/?info=matchit
MatchIt Software and Documentation: http://gking.harvard.edu/matchit/
Browse/Search List Archive: http://lists.hmdc.harvard.edu/lists/matchit/
Hi All,
Thanks a lot for MatchIt, it's helping me out a great deal in my dissertation research. I'm analyzing a large-scale labor market dataset (NLSY97) and am still not sure about how to use survey weights when matching.
Prof. King, in a previous posting you stated: "I'd ignore the sampling weights for estimating causal effects. As long as you condition (in this case match) on the survey weights or (better) the variables that compose the survey weights, you're not going to have any bias."
Just to make sure I understand: does this mean that if I follow your advice (i.e. include the NLSY97 survey weight as a covariate for matching) then the results of any regular post-matching parametric analysis (ANOVA, log-linear, etc.) will be representative of the population?
Any guidance/clarification would be much appreciated.
Sinan
Sinan Gemici, PhD Candidate
Department of Workforce Education
University of Georgia
--
MatchIt mailing list served by Harvard-MIT Data Center
List Address: matchit(a)lists.gking.harvard.edu
Subscribe/Unsubscribe: http://lists.gking.harvard.edu/?info=matchit
MatchIt Software and Documentation: http://gking.harvard.edu/matchit/
Browse/Search List Archive: http://lists.hmdc.harvard.edu/lists/matchit/