Hi,
I'm get an error message when I run imb in Stata (cem runs fine):
L1meas(): 3301 subscript invalid
imbalance(): - function returned error
<istmt>: - function returned error
r(3301);
My code is something like:
imb new_age borninbeijing female hometown01 BJ_hukou Rural_hukoutype
fatheredu motheredu ifpreschooling schoolingathome,
treatment(public_yn)
Any help would be most appreciated!
Thanks,
Prashant
There is also a 'pair' function in the cem package, which I think produces a paired sample out of a CEM match solution.
However, I realized that pair function pairs up instances that are not necessarily matched.
So I modified the pair.r file in the cem package, and force the pair function to pair up instances that are matched already.
Below is what I diid and hope it helps:
pair <- function(obj, data, method=NULL, mpower=2, verbose=0){
nm <- NULL
strataID <- unique(obj$strata)
reservoir <- NULL
for(i in strataID){
####################################################
###########added by hoktay
########use only the instances that are matched
#### used to be
######### idx <- which(obj$strata==i )
####################################################
idx <- which(obj$strata==i & obj$matched==TRUE)
.....
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Sun, 12 Feb 2012 23:44:05 -0800
> From: "Ashkan Moazzez, MD" <ashkanmoazzez(a)ucla.edu>
> To: cem(a)lists.gking.harvard.edu
> Subject: [cem] CEM
> Message-ID: <20120212234405.79195ckdlsb7deth(a)mail.ucla.edu>
> Content-Type: text/plain; charset=ISO-8859-1; DelSp="Yes";
> format="flowed"
>
> Dear members of the CEM list,
> I was wondering if there is a way to extract the data after you match
> them with CEM? Is there an equivalent command like match.data in
> matchit() for CEM?
>
> Best regards,
> Ashkan
>
>
> Ashkan Moazzez, MD
>
>
> ------------------------------
>
Dear members of the CEM list,
I was wondering if there is a way to extract the data after you match
them with CEM? Is there an equivalent command like match.data in
matchit() for CEM?
Best regards,
Ashkan
Ashkan Moazzez, MD