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 <https://www.incae.edu/en>*
Why not apply first CEM using all vars but kbitssw5 and then a matching with caliper using onl kbitssw5?
Kind Regards Cesare A.F. Riillo
On Wednesday, 10 October 2018, 03:04:16 CEST, cem-request(a)lists.gking.harvard.edu <cem-request(a)lists.gking.harvard.edu> wrote:
Send Cem mailing list submissions to
cem(a)lists.gking.harvard.edu
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.gking.harvard.edu/mailman/listinfo/cem
or, via email, send a message with subject or body 'help' to
cem-request(a)lists.gking.harvard.edu
You can reach the person managing the list at
cem-owner(a)lists.gking.harvard.edu
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Cem digest..."
Today's Topics:
1. Re: Matching for a continuous variable (stefano iacus)
----------------------------------------------------------------------
Message: 1
Date: Wed, 10 Oct 2018 03:04:03 +0200
From: stefano iacus <stefano.iacus(a)unimi.it>
To: Emina Omerovic <emina.omerovic(a)mcri.edu.au>
Cc: "king-assist(a)iq.harvard.edu" <king-assist(a)iq.harvard.edu>,
"cem(a)lists.gking.harvard.edu" <cem(a)lists.gking.harvard.edu>
Subject: Re: [cem] Matching for a continuous variable
Message-ID: <EE3D260F-F995-43CE-9253-3BD276C1C1A1(a)unimi.it>
Content-Type: text/plain; charset="utf-8"
Hi Emina,
strata should not overlap in order to have all the CEM statistical properties to hold, i.e. the assumptions of our theory of statistical inference are not fulfilled (see, or last paper: https://doi.org/10.1017/pan.2018.29)
so, I am sorry, the answer is negative (unless you find a way to transform the 1-sd intervals into a sequence of cutpoint.)
Stefano
> On 10 Oct 2018, at 00:30, Emina Omerovic <emina.omerovic(a)mcri.edu.au> wrote:
>
> Hi Stefano,
>
> So if I have a variable of continuous scores and want to match the sample based on scores within 1 sd (e.g. 15) rather than applying the cutpoints which creates categories of scores such that
>
> cem gender kbitssw5 (70 85 100 115 130), treatment (group)
>
> becomes the equivalent of
>
> recode kbitssw5 (0/70 = 1 "Well below average") (70/85 = 2 "Below average") (85/115 = 2 "Average") (115/130 = 3 "Above average") (130/200 = 3 "Well above average"), gen(kbittssw5_5cat)
>
> cem gender kbittssw5_5cat, treatment(group)
>
>
> Can I match based on freely changing cutpoints to maintain that 1 sd ? Eg. A participant with a score of 80 could be matched to someone with a score anywhere between 65 and 95, and not just between 70 and 85
>
>
> Kind regards
> Emina
>
> From: stefano iacus [mailto:stefano.iacus@unimi.it]
> Sent: Tuesday, 2 October 2018 1:55 PM
> To: Emina Omerovic <emina.omerovic(a)mcri.edu.au>
> Cc: cem(a)lists.gking.harvard.edu; king-assist(a)iq.harvard.edu
> Subject: Re: [cem] Matching for a continuous variable
>
> Hi,
> if I understand correctly, you just need to specify the cutpoints argument in the cem() function like on page 10 (bottom) of the pdf document you mention.
> Usually the best thing to do is to write a simple reproducible example (R code + sample of data) so that we can help you to solve your problem.
>
> Best regards
> Stefano
>
> On 26 Sep 2018, at 04:11, Emina Omerovic <emina.omerovic(a)mcri.edu.au <mailto:emina.omerovic@mcri.edu.au>> wrote:
>
>
>
> From: cem-bounces(a)lists.gking.harvard.edu <mailto:cem-bounces@lists.gking.harvard.edu> [mailto:cem-bounces@lists.gking.harvard.edu <mailto:cem-bounces@lists.gking.harvard.edu>] On Behalf Of Emina Omerovic
> Sent: Wednesday, 26 September 2018 11:38 AM
> To: cem(a)lists.gking.harvard.edu <mailto:cem@lists.gking.harvard.edu>
> Subject: [cem] Matching for a continuous variable
>
> Hello,
>
> Using the example provided http://scholar.harvard.edu/files/gking/files/cem.pdf <http://scholar.harvard.edu/files/gking/files/cem.pdf> I am not sure how to approach matching for continuous scores eg. An IQ score. Using my data sample and the automated method, it appears all matches are within about 8 score points. If we wanted to define the coarsening to about within 15 points (eg within 1 SD) how could I do this?
>
> Thank you
>
> Looking forward to the reply
>
> Emina Omerovic BSc, MClAud
> Research Assistant
> Intergenerational Health
>
> Murdoch Children's Research Institute
> The Royal Children's Hospital, 50 Flemington Road
> Parkville, Victoria 3052 Australia
>
> E emina.omerovic(a)mcri.edu.au <mailto:emina.omerovic@mcri.edu.au>
> W mcri.edu.au <https://www.mcri.edu.au/>
>
>
>
> This e-mail and any attachments to it (the "Communication") are, unless otherwise stated, confidential, may contain copyright material and is for the use only of the intended recipient. If you receive the Communication in error, please notify the sender immediately by return e-mail, delete the Communication and the return e-mail, and do not read, copy, retransmit or otherwise deal with it. Any views expressed in the Communication are those of the individual sender only, unless expressly stated to be those of Murdoch Children?s Research Institute (MCRI) ABN 21 006 566 972 or any of its related entities. MCRI does not accept liability in connection with the integrity of or errors in the Communication, computer virus, data corruption, interference or delay arising from or in respect of the Communication.
> -
> --
> cem Mailing List, served by HUIT
> Send messages: cem(a)lists.gking.harvard.edu <mailto:cem@lists.gking.harvard.edu>
> [un]subscribe Options: http://lists.gking.harvard.edu/?info=cem <http://lists.gking.harvard.edu/?info=cem>
> More information on cem: http://gking.harvard.edu/cem <http://gking.harvard.edu/cem>
> Cem mailing list
> Cem(a)lists.gking.harvard.edu <mailto:Cem@lists.gking.harvard.edu>
>
> To unsubscribe from this list or get other information:
>
> https://lists.gking.harvard.edu/mailman/listinfo/cem <https://lists.gking.harvard.edu/mailman/listinfo/cem>
> -
> --
> cem Mailing List, served by HUIT
> Send messages: cem(a)lists.gking.harvard.edu <mailto:cem@lists.gking.harvard.edu>
> [un]subscribe Options: http://lists.gking.harvard.edu/?info=cem <http://lists.gking.harvard.edu/?info=cem>
> More information on cem: http://gking.harvard.edu/cem <http://gking.harvard.edu/cem>
> Cem mailing list
> Cem(a)lists.gking.harvard.edu <mailto:Cem@lists.gking.harvard.edu>
>
> To unsubscribe from this list or get other information:
>
> https://lists.gking.harvard.edu/mailman/listinfo/cem <https://lists.gking.harvard.edu/mailman/listinfo/cem>
>
>
> <image001.jpg>
Hello,
Using the example provided http://scholar.harvard.edu/files/gking/files/cem.pdf I am not sure how to approach matching for continuous scores eg. An IQ score. Using my data sample and the automated method, it appears all matches are within about 8 score points. If we wanted to define the coarsening to about within 15 points (eg within 1 SD) how could I do this?
Thank you
Looking forward to the reply
Emina Omerovic BSc, MClAud
Research Assistant
Intergenerational Health
Murdoch Children's Research Institute
The Royal Children's Hospital, 50 Flemington Road
Parkville, Victoria 3052 Australia
T +61 3 9936 6568
M +61 402 488 443
E emina.omerovic(a)mcri.edu.au<mailto:emina.omerovic@mcri.edu.au>
W mcri.edu.au<https://www.mcri.edu.au/>
Disclaimer
This e-mail and any attachments to it (the "Communication") are, unless otherwise stated, confidential, may contain copyright material and is for the use only of the intended recipient. If you receive the Communication in error, please notify the sender immediately by return e-mail, delete the Communication and the return e-mail, and do not read, copy, retransmit or otherwise deal with it. Any views expressed in the Communication are those of the individual sender only, unless expressly stated to be those of Murdoch Children’s Research Institute (MCRI) ABN 21 006 566 972 or any of its related entities. MCRI does not accept liability in connection with the integrity of or errors in the Communication, computer virus, data corruption, interference or delay arising from or in respect of the Communication.