Hi,
I'm making progress trying to figure out what happened with the NNET.
Reading the appendix, I see that I can tweak the NNET command to change
parameters such as size.
matched<-distance(serv ~
social + peer + home + acad
+ black + male
+ Msocial+ Mpeer+Macad
+ cds7zdy + diag + Mdisc
+ cohort + siteD + siteP +siteW
+ s7pol + Ms7pol
+ teacher + parent + teacher2 + parent2
+ momed + agefb + biodad + Magefb + Mbiodad
+ Ssocial + Speer + Shome + Sacad + Scds7zdy + Scds7ccy
, model="nnet"
, data=ftdata
, discard=2
, entropy=TRUE
)
matched$assign$call
I switched entropy to TRUE just to test this. It seems to work. So far,
so good.
> matched<-matchdef(matched$assign.model$formula
+ , in.sample
+ , pscore
+ , m.order=4
+ , replace=TRUE
+ , caliper=.25
+ , mhvars=c("parent","teacher","s7pol", "Ms7pol", "diag")
+ , exact=c("male", "black" , "siteD", "siteP", "siteW")
+ , data=ftdata
+ )
-matchdef- can't seem to find the formula
>Error in terms.default(formula, data = data) :
> no terms component
>Execution halted
I can just enter the formula again explicitly, but it seems that I should
be able to pass it an object.
thanks for your help.
thanks--
________________________________________________
E. Michael Foster
(W) 814-865-1923
(Fax) 814-863-0000
After 7/1
Work:
Professor of Maternal and Child Health
School of Public Health
University of North Carolina, Chapel Hill
Rosenau Hall, CB# 7445
Chapel Hill, NC 27599-7445
Home:
309 Old Larkspur Way
Chapel Hill, NC 27516
UNC School of Public Health--voted #2 SPH by
. US News
. Association of Hand-to-Fin Carp Fisherman
. Iron Chef (not to be confused with the Iron Dukes!)
Dear Shige,
I have tried to answer your questions below, although will admit that some of
them are current areas of research, so there isn't necessarily one "right"
answer to them. The use of matching in multi-level models and longitudinal
data in particular is a fairly open area.
> My analytic model is a three-level growth model, where the height of
> child i from community j was measured t (t<=5) times. One of the the
> many community-leve covariates is a state policy that has potential
> impact on children's growth. This policy (a dichotamous variable) can
> be conceptualized as a "treatment", and I want to assess the treatment
> effect of this policy on children's growth.
Since you are interested in the effect of a state-level policy, the correct
analysis would be done at the state-level, perhaps using data aggregated up
to the state (e.g., average height of all children in the state). In that
case, you would also want to do the matching at the state-level, finding
similar states that did and did not have the policy. Doing the analysis at
the level of the child assumes you have many more independent units (that
were randomly assigned to get the policy or not) than you really have.
However, I realize that may not be possible with your data (depending on
sample sizes, etc.). But hopefully your analysis (after matching) can
account for this problem somewhat.
It is also the case that this type of setting, with a treatment at one level
(the state) and data at a lower-level (children) is an open area of research.
I have done some very preliminary work in this area, which I can tell you
more about in another email if you would like.
> 1) When I match the two type of communities, do I match only the
> community-level characterstics or do match both the community-level
> and child-level characterstics? I have not seen an example of using
> matching technique in multilevel cases in the literature.
If the analysis will be done at the child-level, you will want to try to
match the community-level and the child-level characteristics. If the
analysis is done at the community level, I would say that you want to match
on both community-level variables and aggregated versions of the child-level
variables. The general idea in matching is to try to get balance (i.e.,
match) on basically all of the covariates that you have!
> 2) After matching using MatchIt, do I need to estimate a full
> three-level growth model (with all the covariates) in order to assess
> the causal effect of the policy, or I only need to estimate a
> simplified model with only the policy in it (in addition to time,
> which is integrated component of growth model)? I am new to the
> matching literature, this is something I have not quite figured out.
That will depend somewhat on how well-matched the matched samples are. If
they are very well matched, you shouldn't need to use the covariates in the
model, and if you do use the covariates it shouldn't affect the results very
much. In our companion paper to the MatchIt software we advocate running the
same model you would have run without matching on the matched sample. So in
that case you would include all of the covariates. That should help with
precision at least.
> 3) Some of the communities (less than 10%) changed their policy during
> the period of observation. Will this cause any problems or provide any
> new modeling opportunities for the matching and post-matching
> modeling?
You will need to set out a clear "time of treatment" (say it was 1999). You
will want to match on all variables measured before that point (before 1999),
and run the outcome analysis using outcomes measured after that point (after
1999). Of course if communities change their policy after 1999 that will
complicate things, but you can still estimate the effect of their having the
policy in 1999. This gets into the issues of noncompliance and the
differences between intent-to-treat estimates and "complier average causal
effect" estimates. You might want to read
Angrist, Joshua D., Guido W. Imbens, and Donald B. Rubin. "Identification of
Causal Effects Using Instrumental Variables." Journal of the American
Statistical Association, Vol. 91, No. 434, June 1996.
to find out more about these types of analyses.
Good luck, and please let me know if you have any other questions.
Sincerely,
Liz Stuart
-
MatchIt mailing list served by Harvard-MIT Data Center
List Address: matchit(a)latte.harvard.edu
Subscribe/Unsubscribe: http://lists.hmdc.harvard.edu/?info=matchit
MatchIt Software and Documentation: http://gking.harvard.edu/matchit/
Dear Colleagues,
My analytic model is a three-level growth model, where the height of
child i from community j was measured t (t<=5) times. One of the the
many community-leve covariates is a state policy that has potential
impact on children's growth. This policy (a dichotamous variable) can
be conceptualized as a "treatment", and I want to assess the treatment
effect of this policy on children's growth.
Of course, communities with different policy are different in some key
respects: educational composition, socioeconomic development, ethnic
composition, etc. At this point, I think propensity score matching can
really help to reduce the problem of model dependene.
Given the above description, I have several specific questions:
1) When I match the two type of communities, do I match only the
community-level characterstics or do match both the community-level
and child-level characterstics? I have not seen an example of using
matching technique in multilevel cases in the literature.
2) After matching using MatchIt, do I need to estimate a full
three-level growth model (with all the covariates) in order to assess
the causal effect of the policy, or I only need to estimate a
simplified model with only the policy in it (in addition to time,
which is integrated component of growth model)? I am new to the
matching literature, this is something I have not quite figured out.
3) Some of the communities (less than 10%) changed their policy during
the period of observation. Will this cause any problems or provide any
new modeling opportunities for the matching and post-matching
modeling?
Thanks!
Best,
Shige
Assistant Professor
Institute of Sociology
Chinese Academy of Social Sciences
-
MatchIt mailing list served by Harvard-MIT Data Center
List Address: matchit(a)latte.harvard.edu
Subscribe/Unsubscribe: http://lists.hmdc.harvard.edu/?info=matchit
MatchIt Software and Documentation: http://gking.harvard.edu/matchit/
Great--thanks!
Is there a way to turn on a trace-like function so I can see specifically
waht is passed to -nnet-.
thanks for responding.
Kosuke Imai wrote:
>Hi Michael,
> In MatchIt, we rely on nnet() in R library "nnet". We use
>"predict.nnet()" to obtain propensity score from the nnet object. It
>appears that in many cases, the output from predict() contains many
>observations that have the same value. In addition, as you observed, it
>seems that the predictive values depend on random seed. Since I don't know
>exactly how nnet is implemented in R, I can neither explain why this
>problem occurs and how to fix it. Sorry that I can't be of further help.
>You might want to contact the author of nnet() or use choose other method
>to estimate the propensity score.
>Best,
>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://www.princeton.edu/~kimai
>---------------------------------------------------------
>
>On Thu, 23 Jun 2005, E. Michael Foster wrote:
>
> > PS: I dropped a variable from exact ("black"), and that didn't make any
> > difference.
> >
> > PPS: If I change the seed, I get something somewhat different:
> >
> > > table(round(matched$data$pscore,digits=2),matched$data$serv)
> >
> > 0 1
> > 0.11 244 34
> > 0.12 5 0
> > 0.13 1 0
> > 0.14 5 0
> > 0.15 4 0
> > 0.16 1 0
> > 0.17 2 0
> > 0.18 2 0
> > 0.2 1 0
> > 0.22 1 0
> > 0.25 1 0
> > 0.28 1 0
> > 0.43 0 1
> > 0.46 0 2
> > 0.49 1 2
> > 0.51 0 4
> > 0.52 1 6
> > 0.53 203 217 <=these are not caused by -round-
> > 0.97 0 1
> >
> > Still, this seems like a pretty limited number of possible values.
> >
> > The following is your original message (or part of it):
> > >Dear Michael,
> > > That is strange. A couple of questions; do you get any warning message?
> > >what does the output of nnet model look like (you can try
> > >summary(m.out$assign.model) where m.out is the output from matchit)? Also,
> > >what happens if you remove (some of) the exact matching variables?
> > >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://www.princeton.edu/~kimai
> > >---------------------------------------------------------
> > >
> > >On Tue, 21 Jun 2005, E. Michael Foster wrote:
> > >
> > > > Hi,
> > > > I admire you folks for taking this on, and I hope you aren't deluged
> > > > with dumb questions.
> > > >
> > > > Here's my question (I hope it's not in the dumb category!)
> > > >
> > > > matched<-matchit(serv ~
> > > > social + peer + home + acad <....>
> > > > , data=ftdata,
> > > > # , model="probit"
> > > > , model="nnet"
> > > > , replace=TRUE
> > > > , discard=2
> > > > , exact=c("male", "black" , "siteD", "siteP", "siteW")
> > > > # , subgroup=5
> > > > # These options don't work for probit
> > > > , iter=300
> > > > , mhvars=c("parent","teacher","s7pol", "Ms7pol", "diag")
> > > > , caliper=.25
> > > > )
> > > >
> > > > One thing that appeals to me about your framework is that I can
> give more
> > > > importance to some covariates than to others.
> > > > In particular, I want the match on race and gender to be exact (and for
> > > > site as well).
> > > >
> > > > Also, within groups of observations with roughly comparable propensity
> > > > scores, I like the idea of refining the match based on other key
> > > > characteristics (such as parent and teacher reports of problem
> behaviors
> > > > and so on).
> > > >
> > > > I can see what MatchIt is doing in terms of the number of observations
> > > that
> > > > are dropped and the number of times observations are used
> repeatedly. So
> > > > far, so good.
> > > >
> > > > here's my problem. When I write out my propensity scores (or tabulate
> > > > them, for that matter), they are the same for all
> observations. How can
> > > > that be? Am I missing something (or doing something stupid!)
> > > >
> > > > thanks,
> > > > michael foster
> > > >
> > > >
> > > >
> > > >
> > > > ________________________________________________
> > > > E. Michael Foster
> > > > (W) 814-865-1923
> > > > (Fax) 814-863-0000
> > > >
> > > > After 7/1
> > > >
> > > > Work:
> > > > Professor of Maternal and Child Health
> > > > and
> > > > Professor of Health Policy
> > > > School of Public Health
> > > > University of North Carolina, Chapel Hill
> > > > Rosenau Hall, CB# 7445
> > > > Chapel Hill, NC 27599-7445
> > > >
> > > > Home:
> > > > 309 Old Larkspur Way
> > > > Chapel Hill, NC 27516
> > > >
> > > >
> > > >
> >
> >
> > ________________________________________________
> > E. Michael Foster
> > (W) 814-865-1923
> > (Fax) 814-863-0000
> >
> > After 7/1
> >
> > Work:
> > Professor of Maternal and Child Health
> > School of Public Health
> > University of North Carolina, Chapel Hill
> > Rosenau Hall, CB# 7445
> > Chapel Hill, NC 27599-7445
> >
> > Home:
> > 309 Old Larkspur Way
> > Chapel Hill, NC 27516
> >
> >
> > UNC School of Public Health--voted #2 SPH by
> > . US News
> > . Association of Hand-to-Fin Carp Fisherman
> > . Iron Chef (not to be confused with the Iron Dukes!)
> >
> >
>
>
>-
>MatchIt mailing list served by Harvard-MIT Data Center
>List Address: matchit(a)latte.harvard.edu
>Subscribe/Unsubscribe: http://lists.hmdc.harvard.edu/?info=matchit
>MatchIt Software and Documentation: http://gking.harvard.edu/matchit/
________________________________________________
E. Michael Foster
(W) 814-865-1923
(Fax) 814-863-0000
After 7/1
Work:
Professor of Maternal and Child Health
School of Public Health
University of North Carolina, Chapel Hill
Rosenau Hall, CB# 7445
Chapel Hill, NC 27599-7445
Home:
309 Old Larkspur Way
Chapel Hill, NC 27516
UNC School of Public Health--voted #2 SPH by
. US News
. Association of Hand-to-Fin Carp Fisherman
. Iron Chef (not to be confused with the Iron Dukes!)
-
MatchIt mailing list served by Harvard-MIT Data Center
List Address: matchit(a)latte.harvard.edu
Subscribe/Unsubscribe: http://lists.hmdc.harvard.edu/?info=matchit
MatchIt Software and Documentation: http://gking.harvard.edu/matchit/
?browser might be helpful.
-----Original Message-----
From: "E. Michael Foster" <foster(a)pop.psu.edu>
Date: Thu, 23 Jun 2005 19:09:06
To:Kosuke Imai <kimai(a)Princeton.Edu>
Cc:matchit@latte.harvard.edu
Subject: Re: [matchit] neural net and constant propensity scores
Great--thanks!
Is there a way to turn on a trace-like function so I can see specifically
waht is passed to -nnet-.
thanks for responding.
Kosuke Imai wrote:
>Hi Michael,
> In MatchIt, we rely on nnet() in R library "nnet". We use
>"predict.nnet()" to obtain propensity score from the nnet object. It
>appears that in many cases, the output from predict() contains many
>observations that have the same value. In addition, as you observed, it
>seems that the predictive values depend on random seed. Since I don't know
>exactly how nnet is implemented in R, I can neither explain why this
>problem occurs and how to fix it. Sorry that I can't be of further help.
>You might want to contact the author of nnet() or use choose other method
>to estimate the propensity score.
>Best,
>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://www.princeton.edu/~kimai
>---------------------------------------------------------
>
>On Thu, 23 Jun 2005, E. Michael Foster wrote:
>
> > PS: I dropped a variable from exact ("black"), and that didn't make any
> > difference.
> >
> > PPS: If I change the seed, I get something somewhat different:
> >
> > > table(round(matched$data$pscore,digits=2),matched$data$serv)
> >
> > 0 1
> > 0.11 244 34
> > 0.12 5 0
> > 0.13 1 0
> > 0.14 5 0
> > 0.15 4 0
> > 0.16 1 0
> > 0.17 2 0
> > 0.18 2 0
> > 0.2 1 0
> > 0.22 1 0
> > 0.25 1 0
> > 0.28 1 0
> > 0.43 0 1
> > 0.46 0 2
> > 0.49 1 2
> > 0.51 0 4
> > 0.52 1 6
> > 0.53 203 217 <=these are not caused by -round-
> > 0.97 0 1
> >
> > Still, this seems like a pretty limited number of possible values.
> >
> > The following is your original message (or part of it):
> > >Dear Michael,
> > > That is strange. A couple of questions; do you get any warning message?
> > >what does the output of nnet model look like (you can try
> > >summary(m.out$assign.model) where m.out is the output from matchit)? Also,
> > >what happens if you remove (some of) the exact matching variables?
> > >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://www.princeton.edu/~kimai
> > >---------------------------------------------------------
> > >
> > >On Tue, 21 Jun 2005, E. Michael Foster wrote:
> > >
> > > > Hi,
> > > > I admire you folks for taking this on, and I hope you aren't deluged
> > > > with dumb questions.
> > > >
> > > > Here's my question (I hope it's not in the dumb category!)
> > > >
> > > > matched<-matchit(serv ~
> > > > social + peer + home + acad <....>
> > > > , data=ftdata,
> > > > # , model="probit"
> > > > , model="nnet"
> > > > , replace=TRUE
> > > > , discard=2
> > > > , exact=c("male", "black" , "siteD", "siteP", "siteW")
> > > > # , subgroup=5
> > > > # These options don't work for probit
> > > > , iter=300
> > > > , mhvars=c("parent","teacher","s7pol", "Ms7pol", "diag")
> > > > , caliper=.25
> > > > )
> > > >
> > > > One thing that appeals to me about your framework is that I can
> give more
> > > > importance to some covariates than to others.
> > > > In particular, I want the match on race and gender to be exact (and for
> > > > site as well).
> > > >
> > > > Also, within groups of observations with roughly comparable propensity
> > > > scores, I like the idea of refining the match based on other key
> > > > characteristics (such as parent and teacher reports of problem
> behaviors
> > > > and so on).
> > > >
> > > > I can see what MatchIt is doing in terms of the number of observations
> > > that
> > > > are dropped and the number of times observations are used
> repeatedly. So
> > > > far, so good.
> > > >
> > > > here's my problem. When I write out my propensity scores (or tabulate
> > > > them, for that matter), they are the same for all
> observations. How can
> > > > that be? Am I missing something (or doing something stupid!)
> > > >
> > > > thanks,
> > > > michael foster
> > > >
> > > >
> > > >
> > > >
> > > > ________________________________________________
> > > > E. Michael Foster
> > > > (W) 814-865-1923
> > > > (Fax) 814-863-0000
> > > >
> > > > After 7/1
> > > >
> > > > Work:
> > > > Professor of Maternal and Child Health
> > > > and
> > > > Professor of Health Policy
> > > > School of Public Health
> > > > University of North Carolina, Chapel Hill
> > > > Rosenau Hall, CB# 7445
> > > > Chapel Hill, NC 27599-7445
> > > >
> > > > Home:
> > > > 309 Old Larkspur Way
> > > > Chapel Hill, NC 27516
> > > >
> > > >
> > > >
> >
> >
> > ________________________________________________
> > E. Michael Foster
> > (W) 814-865-1923
> > (Fax) 814-863-0000
> >
> > After 7/1
> >
> > Work:
> > Professor of Maternal and Child Health
> > School of Public Health
> > University of North Carolina, Chapel Hill
> > Rosenau Hall, CB# 7445
> > Chapel Hill, NC 27599-7445
> >
> > Home:
> > 309 Old Larkspur Way
> > Chapel Hill, NC 27516
> >
> >
> > UNC School of Public Health--voted #2 SPH by
> > . US News
> > . Association of Hand-to-Fin Carp Fisherman
> > . Iron Chef (not to be confused with the Iron Dukes!)
> >
> >
>
>
>-
>MatchIt mailing list served by Harvard-MIT Data Center
>List Address: matchit(a)latte.harvard.edu
>Subscribe/Unsubscribe: http://lists.hmdc.harvard.edu/?info=matchit
>MatchIt Software and Documentation: http://gking.harvard.edu/matchit/
________________________________________________
E. Michael Foster
(W) 814-865-1923
(Fax) 814-863-0000
After 7/1
Work:
Professor of Maternal and Child Health
School of Public Health
University of North Carolina, Chapel Hill
Rosenau Hall, CB# 7445
Chapel Hill, NC 27599-7445
Home:
309 Old Larkspur Way
Chapel Hill, NC 27516
UNC School of Public Health--voted #2 SPH by
. US News
. Association of Hand-to-Fin Carp Fisherman
. Iron Chef (not to be confused with the Iron Dukes!)
-
MatchIt mailing list served by Harvard-MIT Data Center
List Address: matchit(a)latte.harvard.edu
Subscribe/Unsubscribe: http://lists.hmdc.harvard.edu/?info=matchit
MatchIt Software and Documentation: http://gking.harvard.edu/matchit/
--
David Kane
Kane Capital Management
dave(a)kanecap.com
-
MatchIt mailing list served by Harvard-MIT Data Center
List Address: matchit(a)latte.harvard.edu
Subscribe/Unsubscribe: http://lists.hmdc.harvard.edu/?info=matchit
MatchIt Software and Documentation: http://gking.harvard.edu/matchit/
PS: I dropped a variable from exact ("black"), and that didn't make any
difference.
PPS: If I change the seed, I get something somewhat different:
> table(round(matched$data$pscore,digits=2),matched$data$serv)
0 1
0.11 244 34
0.12 5 0
0.13 1 0
0.14 5 0
0.15 4 0
0.16 1 0
0.17 2 0
0.18 2 0
0.2 1 0
0.22 1 0
0.25 1 0
0.28 1 0
0.43 0 1
0.46 0 2
0.49 1 2
0.51 0 4
0.52 1 6
0.53 203 217 <=these are not caused by -round-
0.97 0 1
Still, this seems like a pretty limited number of possible values.
The following is your original message (or part of it):
>Dear Michael,
> That is strange. A couple of questions; do you get any warning message?
>what does the output of nnet model look like (you can try
>summary(m.out$assign.model) where m.out is the output from matchit)? Also,
>what happens if you remove (some of) the exact matching variables?
>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://www.princeton.edu/~kimai
>---------------------------------------------------------
>
>On Tue, 21 Jun 2005, E. Michael Foster wrote:
>
> > Hi,
> > I admire you folks for taking this on, and I hope you aren't deluged
> > with dumb questions.
> >
> > Here's my question (I hope it's not in the dumb category!)
> >
> > matched<-matchit(serv ~
> > social + peer + home + acad <....>
> > , data=ftdata,
> > # , model="probit"
> > , model="nnet"
> > , replace=TRUE
> > , discard=2
> > , exact=c("male", "black" , "siteD", "siteP", "siteW")
> > # , subgroup=5
> > # These options don't work for probit
> > , iter=300
> > , mhvars=c("parent","teacher","s7pol", "Ms7pol", "diag")
> > , caliper=.25
> > )
> >
> > One thing that appeals to me about your framework is that I can give more
> > importance to some covariates than to others.
> > In particular, I want the match on race and gender to be exact (and for
> > site as well).
> >
> > Also, within groups of observations with roughly comparable propensity
> > scores, I like the idea of refining the match based on other key
> > characteristics (such as parent and teacher reports of problem behaviors
> > and so on).
> >
> > I can see what MatchIt is doing in terms of the number of observations
> that
> > are dropped and the number of times observations are used repeatedly. So
> > far, so good.
> >
> > here's my problem. When I write out my propensity scores (or tabulate
> > them, for that matter), they are the same for all observations. How can
> > that be? Am I missing something (or doing something stupid!)
> >
> > thanks,
> > michael foster
> >
> >
> >
> >
> > ________________________________________________
> > E. Michael Foster
> > (W) 814-865-1923
> > (Fax) 814-863-0000
> >
> > After 7/1
> >
> > Work:
> > Professor of Maternal and Child Health
> > and
> > Professor of Health Policy
> > School of Public Health
> > University of North Carolina, Chapel Hill
> > Rosenau Hall, CB# 7445
> > Chapel Hill, NC 27599-7445
> >
> > Home:
> > 309 Old Larkspur Way
> > Chapel Hill, NC 27516
> >
> >
> >
________________________________________________
E. Michael Foster
(W) 814-865-1923
(Fax) 814-863-0000
After 7/1
Work:
Professor of Maternal and Child Health
School of Public Health
University of North Carolina, Chapel Hill
Rosenau Hall, CB# 7445
Chapel Hill, NC 27599-7445
Home:
309 Old Larkspur Way
Chapel Hill, NC 27516
UNC School of Public Health--voted #2 SPH by
. US News
. Association of Hand-to-Fin Carp Fisherman
. Iron Chef (not to be confused with the Iron Dukes!)
Good morning
here's my program and output file.
I know the basics of neural nets, and I don't see anything wrong with the
output generated.
Do you ?
thanks,
michael
The following is your original message (or part of it):
>Dear Michael,
> That is strange. A couple of questions; do you get any warning message?
>what does the output of nnet model look like (you can try
>summary(m.out$assign.model) where m.out is the output from matchit)? Also,
>what happens if you remove (some of) the exact matching variables?
>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://www.princeton.edu/~kimai
>---------------------------------------------------------
>
>On Tue, 21 Jun 2005, E. Michael Foster wrote:
>
> > Hi,
> > I admire you folks for taking this on, and I hope you aren't deluged
> > with dumb questions.
> >
> > Here's my question (I hope it's not in the dumb category!)
> >
> > matched<-matchit(serv ~
> > social + peer + home + acad <....>
> > , data=ftdata,
> > # , model="probit"
> > , model="nnet"
> > , replace=TRUE
> > , discard=2
> > , exact=c("male", "black" , "siteD", "siteP", "siteW")
> > # , subgroup=5
> > # These options don't work for probit
> > , iter=300
> > , mhvars=c("parent","teacher","s7pol", "Ms7pol", "diag")
> > , caliper=.25
> > )
> >
> > One thing that appeals to me about your framework is that I can give more
> > importance to some covariates than to others.
> > In particular, I want the match on race and gender to be exact (and for
> > site as well).
> >
> > Also, within groups of observations with roughly comparable propensity
> > scores, I like the idea of refining the match based on other key
> > characteristics (such as parent and teacher reports of problem behaviors
> > and so on).
> >
> > I can see what MatchIt is doing in terms of the number of observations
> that
> > are dropped and the number of times observations are used repeatedly. So
> > far, so good.
> >
> > here's my problem. When I write out my propensity scores (or tabulate
> > them, for that matter), they are the same for all observations. How can
> > that be? Am I missing something (or doing something stupid!)
> >
> > thanks,
> > michael foster
> >
> >
> >
> >
> > ________________________________________________
> > E. Michael Foster
> > (W) 814-865-1923
> > (Fax) 814-863-0000
> >
> > After 7/1
> >
> > Work:
> > Professor of Maternal and Child Health
> > and
> > Professor of Health Policy
> > School of Public Health
> > University of North Carolina, Chapel Hill
> > Rosenau Hall, CB# 7445
> > Chapel Hill, NC 27599-7445
> >
> > Home:
> > 309 Old Larkspur Way
> > Chapel Hill, NC 27516
> >
> >
> >
________________________________________________
E. Michael Foster
(W) 814-865-1923
(Fax) 814-863-0000
After 7/1
Work:
Professor of Maternal and Child Health
School of Public Health
University of North Carolina, Chapel Hill
Rosenau Hall, CB# 7445
Chapel Hill, NC 27599-7445
Home:
309 Old Larkspur Way
Chapel Hill, NC 27516
UNC School of Public Health--voted #2 SPH by
. US News
. Association of Hand-to-Fin Carp Fisherman
. Iron Chef (not to be confused with the Iron Dukes!)
Hi,
I admire you folks for taking this on, and I hope you aren't deluged
with dumb questions.
Here's my question (I hope it's not in the dumb category!)
matched<-matchit(serv ~
social + peer + home + acad <....>
, data=ftdata,
# , model="probit"
, model="nnet"
, replace=TRUE
, discard=2
, exact=c("male", "black" , "siteD", "siteP", "siteW")
# , subgroup=5
# These options don't work for probit
, iter=300
, mhvars=c("parent","teacher","s7pol", "Ms7pol", "diag")
, caliper=.25
)
One thing that appeals to me about your framework is that I can give more
importance to some covariates than to others.
In particular, I want the match on race and gender to be exact (and for
site as well).
Also, within groups of observations with roughly comparable propensity
scores, I like the idea of refining the match based on other key
characteristics (such as parent and teacher reports of problem behaviors
and so on).
I can see what MatchIt is doing in terms of the number of observations that
are dropped and the number of times observations are used repeatedly. So
far, so good.
here's my problem. When I write out my propensity scores (or tabulate
them, for that matter), they are the same for all observations. How can
that be? Am I missing something (or doing something stupid!)
thanks,
michael foster
________________________________________________
E. Michael Foster
(W) 814-865-1923
(Fax) 814-863-0000
After 7/1
Work:
Professor of Maternal and Child Health
and
Professor of Health Policy
School of Public Health
University of North Carolina, Chapel Hill
Rosenau Hall, CB# 7445
Chapel Hill, NC 27599-7445
Home:
309 Old Larkspur Way
Chapel Hill, NC 27516
Dear Dr. Piccone,
I am glad to hear our MatchIt software and documentation has been helpful for
you.
It sounds like you want to output a data frame with just the matched units,
as output from MatchIt. To do that, you can use the match.data() function,
which pulls the matched data set (matched treated and matched controls) from
the matchit object itself. What you were doing before doesn't work because
the MatchIt output object includes other output objects in addition to the
data frame itself.
So I think you will want to do something like:
matched.data <- match.data(social)
write.table(matched.data,"shaka.txt",sep="
",quote=FALSE,row.names=FALSE,col.names= FALSE)
You can find out more information on match.data() using help(match.data)
after loading MatchIt.
Also, in terms of the listserve, I believe it is still operating. Did you
try to post a message there without success?
I hope this is helpful; please let us know if you have any other questions.
Sincerely,
Liz Stuart
> -----Original Message-----
> From: owner-matchit(a)latte.harvard.edu
> [mailto:owner-matchit@latte.harvard.edu]On Behalf Of Gary King
> Sent: Thursday, June 16, 2005 8:44 AM
> To: matchit(a)latte.harvard.edu
> Subject: [matchit] Fw: Greetings,
>
>
>
> -----Original Message-----
> From: "Piccone, Jason E." <Jason.Piccone(a)dce.virginia.gov>
> Date: Thu, 16 Jun 2005 08:28:45
> To:owner-matchit@latte.harvard.edu
> Subject: Greetings,
>
>
> Hello,
>
> I first want to thank you for writing this excellent software
> and the fine document (Ho et al, 2005) that I have found
> immeasurably helpful.
>
> Question: Is the matchit listserve no longer in operation?
>
> If you take technical questions, please continue below:
> I am attempting to export a text file after using the MatchIt
> package to match control with treatment subjects. I
> attempted to write.table and used the following syntax:
>
> "write.table(social,"shaka.txt",sep="
> ",quote=FALSE,row.names=FALSE,col.names= FALSE)"
>
> But received the following error message:
> "Error in as.data.frame.default(x[[i]], optional = TRUE) :
> cannot coerce class "matchit" into a data.frame"
>
> I thought that maybe I had to convert to a data frame, and
> tinkered with data.frame, as.data.frame, and is.data.frame,
> but this didn't work (although I could had done it
> improperly). Please excuse my lack of experience/knowledge in R.
>
> Any guidance will be greatly appreciated.
>
>
>
>
> Jason E. Piccone, Ph.D.
> Research and Evaluation Specialist
> Department of Correctional Education
>
>
> -
> MatchIt mailing list served by Harvard-MIT Data Center
> List Address: matchit(a)latte.harvard.edu
> Subscribe/Unsubscribe: http://lists.hmdc.harvard.edu/?info=tchit
> MatchIt Software and Documentation: http://gking.harvard.edu/matchit/
>
-
MatchIt mailing list served by Harvard-MIT Data Center
List Address: matchit(a)latte.harvard.edu
Subscribe/Unsubscribe: http://lists.hmdc.harvard.edu/?info=matchit
MatchIt Software and Documentation: http://gking.harvard.edu/matchit/
-----Original Message-----
From: "Piccone, Jason E." <Jason.Piccone(a)dce.virginia.gov>
Date: Thu, 16 Jun 2005 08:28:45
To:owner-matchit@latte.harvard.edu
Subject: Greetings,
Hello,
I first want to thank you for writing this excellent software and the fine document (Ho et al, 2005) that I have found immeasurably helpful.
Question: Is the matchit listserve no longer in operation?
If you take technical questions, please continue below:
I am attempting to export a text file after using the MatchIt package to match control with treatment subjects. I attempted to write.table and used the following syntax:
"write.table(social,"shaka.txt",sep=" ",quote=FALSE,row.names=FALSE,col.names= FALSE)"
But received the following error message:
"Error in as.data.frame.default(x[[i]], optional = TRUE) : cannot coerce class "matchit" into a data.frame"
I thought that maybe I had to convert to a data frame, and tinkered with data.frame, as.data.frame, and is.data.frame, but this didn't work (although I could had done it improperly). Please excuse my lack of experience/knowledge in R.
Any guidance will be greatly appreciated.
Jason E. Piccone, Ph.D.
Research and Evaluation Specialist
Department of Correctional Education
-
MatchIt mailing list served by Harvard-MIT Data Center
List Address: matchit(a)latte.harvard.edu
Subscribe/Unsubscribe: http://lists.hmdc.harvard.edu/?info=matchit
MatchIt Software and Documentation: http://gking.harvard.edu/matchit/