Hello,
I noticed a few questions in the archives that pointed at this issue,
but I couldn't find an actual answer. I need to use probability
weights when the propensity score estimates are computed via glm. I
can't figure out how to do this with matchit. It seems like I should
be able to either feed the weights to glm (which I am pretty sure
matchit uses) or just compute those propensity scores independently
and then give those to matchit.
Any advice?
Thanks,
Ben
--
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/
Do you have the latest version of Zelig? It works for me:
> setx(z.out1, age = 20)
(Intercept) age as.factor(race)white
1 1 20 1
Kosuke
---------------------------------------------------------
Kosuke Imai Office: Corwin Hall 041
Assistant Professor Phone: 609-258-6601
Department of Politics eFax: 973-556-1929
Princeton University Email: kimai(a)Princeton.Edu
Princeton, NJ 08544-1012 http://imai.princeton.edu/
---------------------------------------------------------
On Thu, 15 May 2008, Andrew Stokes wrote:
> Hello,
>
> When I run a regression using as.factor to create indicator variables from
> categorical variables, the subsequent simulation steps using setx and sim do
> not work. When I run the regression where the indicator variables were
> created beforehand, the simulation steps work. So for example, I run
>
> z.out<-zelig(severe_anemic ~ net_status + anc_visit + as.factor(age) +
> as.factor(wealth) + as.factor(region), model = "logit", data = my.data)
>
> And then I run:
>
> x.out0<-setx(z.out, net_status = 0)
> x.out1<-setx(z.out, net_stutus = 1)
> s.out<-sim(z.out, x=x.out0, x1=x.out1, num=1000)
>
> After each of the preceding lines, I receive this error:
>
> Error in `contrasts<-`(`*tmp*`, value = "contr.treatment") :
> contrasts can be applied only to factors with 2 or more levels
>
> Thanks for any advice!
>
> Andrew Stokes
> Institute for Health Metrics and Evaluation
>
--
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/
Hello,
Does anyone know why "setx" and "sim" do not work on a regression run using
"as.factor" to split up categorical data into indicator variables?
This is the error message I receive:
Error in `contrasts<-`(`*tmp*`, value = "contr.treatment") :
contrasts can be applied only to factors with 2 or more levels
Thanks!
Andy Stokes
Hi,
Is there a way to extract data on the treated cases that were discarded as a result of matching and on the control cases that were unmatched?
Thanks!
Kerry
Kerry Richmond
Department of Criminology and Criminal Justice
University of Maryland, College Park
--
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/