Dear Sara,
can you share the data and few lines of script to us so that we can reproduce (and possibly fix) the error?

Best regards
Stefano

On 25 Oct 2018, at 00:15, Sara Benetti <sara.benetti@incae.edu> wrote:

Hello, 

 

I’ve just begun to use CEM package for R.
My database has 657 obs., no missing values, treatment is a dummy (1 is treated, 0 is untreated). 
This is a summary of my variables: 
 
> is.data.frame(NHq1)
[1] TRUE
>
> summary(NHq1)
   Treatment          Female            Size           Pcoffee       
 Min.   :0.0000   Min.   :0.0000   Min.   : 0.084   Min.   :0.008333 
 1st Qu.:0.0000   1st Qu.:0.0000   1st Qu.: 1.400   1st Qu.:0.333333 
 Median :1.0000   Median :0.0000   Median : 3.000   Median :0.600000 
 Mean   :0.6591   Mean   :0.1492   Mean   : 6.072   Mean   :0.585863 
 3rd Qu.:1.0000   3rd Qu.:0.0000   3rd Qu.: 7.500   3rd Qu.:0.833333 
 Max.   :1.0000   Max.   :1.0000   Max.   :64.000   Max.   :1.000000 
      Age5           Age5.15           Age15         Productivity   
 Min.   :0.0000   Min.   :0.0000   Min.   :0.0000   Min.   :  16.43 
 1st Qu.:0.0000   1st Qu.:0.0000   1st Qu.:0.0000   1st Qu.: 720.00 
 Median :0.0000   Median :1.0000   Median :0.0000   Median :1271.89 
 Mean   :0.2907   Mean   :0.6058   Mean   :0.1035   Mean   :1393.20 
 3rd Qu.:1.0000   3rd Qu.:1.0000   3rd Qu.:0.0000   3rd Qu.:1920.00 
 Max.   :1.0000   Max.   :1.0000   Max.   :1.0000   Max.   :7119.05 
   Familiness         Poverty           GDP      
 Min.   :0.00000   Min.   : 0.00   Min.   : 2653 
 1st Qu.:0.05096   1st Qu.: 8.60   1st Qu.: 2671 
 Median :0.43421   Median :23.90   Median : 6516 
 Mean   :0.46640   Mean   :33.57   Mean   : 5914 
 3rd Qu.:0.85000   3rd Qu.:55.00   3rd Qu.: 7526 
 Max.   :1.00000   Max.   :99.60   Max.   :12069
 
I’m trying to calculate the imbalance but I get the following error: 
 
> todrop <- c("Productivity", "Treatment", "GDP")
> imbalance(group=Treatment, data=NHq1, drop=todrop)
Error in t1 > 0 & t2 > 0 : non-conformable arrays
 
I could implement the cem function without problems, but if I include eval.imbalance = TRUE in the argument, I get the same error:
 
> mat1 <- cem(treatment = "Treatment", data=NHq1, drop=c("Productivity", "GDP"), keep.all = TRUE, eval.imbalance = TRUE)
Error in t1 > 0 & t2 > 0 : non-conformable arrays
 
> mat1 <- cem(treatment = "Treatment", data=NHq1, drop=c("Productivity", "GDP"), keep.all = TRUE)
> mat1
           G0  G1
All       224 433
Matched    35  52
Unmatched 189 381
 
 

Do you have any idea of what could be wrong with the database?

Thank you in advance for your help.

Best Regards,

Sara Benetti | Researcher 
INCAE Business School 

-
--
cem Mailing List, served by HUIT
Send messages: cem@lists.gking.harvard.edu
[un]subscribe Options: http://lists.gking.harvard.edu/?info=cem
More information on cem: http://gking.harvard.edu/cem
Cem mailing list
Cem@lists.gking.harvard.edu

To unsubscribe from this list or get other information:

https://lists.gking.harvard.edu/mailman/listinfo/cem