Hello
I'm new to propensity score matching. I'm working with a data set that
contains kids who were randomized to treatment or control. In addition, a
normative sample was chosen. When I try to predict treatment status I get
the error listed below:
m.outt <- matchit(trt ~ totaltcsz + black + male +
+ shf1aac + iee1asc + hic1pha + hic1rps + pdr1oar + sps1mpc +
+ scp1tot + p1bses + fsc1dps + lch1ppn + lch1vpn + lch1str + ipe1fam +
+ ipe1fri + pvi1cfi + pvi1hom + irs1war + wjr1slw + erq1tnc + tocaaac +
fsc1dep +
+ prq1disc + znhq1tot + zwsr1tot + durh +nash + wash
+ , data=FT2 , method="optimal" )
Error in value[[1]] : subscript out of bounds
In addition: Warning messages:
1: no non-missing arguments to max; returning -Inf
2: no non-missing arguments to max; returning -Inf
3: no non-missing arguments to min; returning Inf
4: no non-missing arguments to min; returning Inf
However, in checking that my syntax was correct, I tried to predict the
propensity to be male or black. In both cases the program converged (so at
least I know that the data aren't screwy and that the syntax is right).
Does anyone have some suggestions for where the problem may be? (I've tried
several different matching techniques can't get the program to converge....)
Thanks
Beth
I'm working with a relatively small dataset that I created for a class.
> ccdp<-na.omit(ccdp)
> ccdp$singlem<-as.numeric(ccdp$singlem)
> str(ccdp)
'data.frame': 1471 obs. of 23 variables:
$ intno : int 4 4 4 4 4 4 4 4 4 4 ...
$ lbw : int 1 1 0 1 0 0 0 0 0 1 ...
$ brnearly : int 1 0 0 0 0 0 0 0 0 0 ...
$ pcare : int 0 0 0 0 0 0 1 0 0 1 ...
$ cigs : int 0 1 1 0 0 0 0 0 0 0 ...
$ alch : int 0 0 0 0 0 0 0 0 0 0 ...
$ drugs : int 0 0 0 0 0 0 0 0 0 1 ...
$ nobinfo : int 0 0 0 0 1 1 0 0 0 0 ...
$ extstan4 : int 57 54 36 51 60 62 46 47 60 57 ...
$ intstan4 : int 63 55 37 43 61 60 67 49 61 45 ...
$ extstan6 : int 62 51 38 43 54 69 46 45 52 66 ...
$ intstan6 : int 64 53 34 47 66 72 66 45 61 49 ...
$ extstan8 : int 62 54 49 47 62 65 53 54 52 52 ...
$ intstan8 : int 48 40 34 34 72 71 74 48 55 33 ...
$ extstan10: int 56 47 47 54 53 59 48 58 58 67 ...
$ intstan10: int 33 34 42 42 59 63 48 51 63 51 ...
$ famstat4 : Factor w/ 6 levels "Single mom","Bio Dad",..: 1 2 2 5 2
2 2 6 6 2 ...
$ birthage : num 20.7 19.7 16.5 21.0 22.8 ...
$ black : num 1 1 1 0 1 1 1 1 1 1 ...
$ momhsdo : num 0 1 1 0 0 1 0 1 1 0 ...
$ subhsg : num 1 1 1 1 1 0 1 1 1 1 ...
$ poor : num 1 1 1 1 1 1 1 1 1 1 ...
$ singlem : num 1 0 0 0 0 0 0 0 0 0 ...
- attr(*, "na.action")=Class 'omit' Named int [1:1468] 1 3 4 7 12 13
16 17 19 21 ...
.. ..- attr(*, "names")= chr [1:1468] "1" "3" "4" "7" ...
> ccdp<-ccdp[nobinfo==0,]
> m.out <- matchit(singlem ~
black+lbw+brnearly+pcare+cigs+alch+drugs+momhsdo+poor+subhsg+birthage,
+ data=ccdp , method="full", distance="probit", discard="both" )
Loading required package: optmatch
Error in d[i, ] <- abs(d1[i] - d0) : number of items to replace is not a
multiple of replacement length
I'm not sure I see what I'm doing wrong.
thanks,
Michael Foster
--
________________________________________________
E. Michael Foster
getmike.info
download vcard: www.unc.edu/~emfoster/Foster.vcf
Professor of Maternal and Child Health
of Health Policy and Administration
of Biostatistics (adjunct)
Associate Chair for Faculty Advancement
Professor of Psychology (adjunct)
Arizona State University
(W) 919-966-3773
(F) 919-966-0458
Office: 407C Rosenau Hall << use for FEDEX
School of Public Health
University of North Carolina, Chapel Hill
Rosenau Hall, Campus Box# 7445
Chapel Hill, NC 27599-7445
Visit the new FAQ section of my web site where I
address questions such as
25) [Dubya] "You were quoted as saying that 'I'm a lot like Don Rumsfield'. I'm a little surprised."
www.FosterFAQ.blogspot.comwww.unc.edu/~emfoster
In describing his recovery from addiction, my favorite actor, Robert Downey, jr., commented that
“It’s not an elephant any more. It’s just f---ing ants in the kitchen, like everything else.”
Hopefully, I'll be able to say the same thing about cancer.
"Cancer is a gift in a really ugly package"
- Julie the nurse
"Cancer is like having an anvil fall on your head. If it doesn't kill you, it gets your attention."
- Mike the patient
--
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/