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.
I am interested in using CEM for survival data in STATA.
I think that I use a weighting command in stset, and then use stcox as per usual
Can anyone tell me the exact process and programming?
What commands are used for post estimation to show balance between the matched groups after weighting?
Thanks
Confidentiality Statement – The contents of this e-mail, including its attachment, are intended for the exclusive use of the recipient and may contain confidential or privileged information. If you are not the intended recipient, you are strictly prohibited from reading, using, disclosing, copying, or distributing this e-mail or any of its contents. If you received this e-mail in error, please notify the sender by reply e-mail immediately and permanently delete this e-mail and its attachments, along with any copies thereof.
Thank you.
Déclaration de confidentialité - Ce courriel, y compris ses pièces jointes, s’adresse au destinataire uniquement et pourrait contenir des renseignements confidentiels. Si vous n’êtes pas le bon destinataire, il est strictement interdit de lire, d’utiliser, de divulguer, de copier ou de diffuser ce courriel ou son contenu, en partie ou en entier. Si vous avez reçu ce courriel par erreur, veuillez en informer immédiatement l’expéditeur, puis effacez le courriel ainsi que les pièces jointes et toute autre copie.
Merci.
Dear Fraser Rubens,
After preprocessing data with CEM, you can use any statistical model you would have applied to the raw data. see gking.harvard.edu/files/gking/files/cem-stata.pdf
For the detailed explanation on CEM weights see explanation of Weights are here An explanation of weights in CEM
|
|
|
| | |
|
|
|
| |
An explanation of weights in CEM
An Explanation for CEM Weights Gary King 25 March 2012 (j.mp/CEMweights) Goal: With a CEM matched sample, the ...
|
|
|
for an example of use of cem with sampling weighs see Beyond the question “Does it pay to be green?”: How much green? and when?
|
|
| |
Beyond the question “Does it pay to be green?”: How much green? and when?
This research investigates the relationship between green management and performance in Italian firms. The analy...
|
|
|
cheers
cesare
On Tuesday, 7 August 2018, 18:00:06 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. Use of CEM for time-to-event data (Fraser Rubens)
----------------------------------------------------------------------
Message: 1
Date: Mon, 06 Aug 2018 13:34:11 -0400
From: "Fraser Rubens" <frubens(a)ottawaheart.ca>
To: <cem(a)lists.gking.harvard.edu>
Subject: [cem] Use of CEM for time-to-event data
Message-ID: <5B684E53020000780003884E(a)smtpin.ottawaheart.ca>
Content-Type: text/plain; charset=Windows-1254
I am interested in using CEM for survival data in STATA.
I think that I use a weighting command in stset, and then use stcox as per usual
Can anyone tell me the exact process and programming?
What commands are used for post estimation to show balance between the matched groups after weighting?
Thanks
Confidentiality Statement ? The contents of this e-mail, including its attachment, are intended for the exclusive use of the recipient and may contain confidential or privileged information. If you are not the intended recipient, you are strictly prohibited from reading, using, disclosing, copying, or distributing this e-mail or any of its contents. If you received this e-mail in error, please notify the sender by reply e-mail immediately and permanently delete this e-mail and its attachments, along with any copies thereof.
Thank you.
D?claration de confidentialit? - Ce courriel, y compris ses pi?ces jointes, s?adresse au destinataire uniquement et pourrait contenir des renseignements confidentiels. Si vous n??tes pas le bon destinataire, il est strictement interdit de lire, d?utiliser, de divulguer, de copier ou de diffuser ce courriel ou son contenu, en partie ou en entier. Si vous avez re?u ce courriel par erreur, veuillez en informer imm?diatement l?exp?diteur, puis effacez le courriel ainsi que les pi?ces jointes et toute autre copie.
Merci.
------------------------------
_______________________________________________
Cem mailing list
Cem(a)lists.gking.harvard.edu
To unsubscribe from this list or get other information:
https://lists.gking.harvard.edu/mailman/listinfo/cem
End of Cem Digest, Vol 108, Issue 1
***********************************
To whom it may concern,
I am having the same problem as this post (
https://stackoverflow.com/questions/50211669/matchit-cem-subscript-out-of-b…),
receiving the following error message:
Error in `[.default`(tmp, x, bg) : subscript out of bounds
I tried to use cem directly but still got the error message.
My dataset works fine with other matching methods, and has observations
where no matching is available.
Any suggestion would be highly appreciated! Thank you!
weights are described in j.mp/CEMweights I'd suggest you have a look at
that
Gary
--
*Gary King* - Albert J. Weatherhead III University Professor - Director,
IQSS <http://iq.harvard.edu/> - Harvard University
GaryKing.org - King(a)Harvard.edu - @KingGary <https://twitter.com/kinggary> -
617-500-7570 - Assistant <king-assist(a)iq.harvard.edu>: 617-495-9271
On Mon, May 21, 2018 at 10:14 AM fang zhang <fazhang2000(a)hotmail.com> wrote:
> Hi All,
>
>
> Do we need to use weights and adjust for all the covariates used
> in CEM again to avoid possible residual confounding? There is no need for
> adjust for the covariates if the CEM makes perfect/Multivariate L1->0 match?
>
> Thanks!
>
>
> Fang
>
Hi All,
Do we need to use weights and adjust for all the covariates used in CEM again to avoid possible residual confounding? There is no need for adjust for the covariates if the CEM makes perfect/Multivariate L1->0 match?
Thanks!
Fang
please see j.mp/CEMweights
Gary
--
*Gary King* - Albert J. Weatherhead III University Professor - Director,
IQSS <http://iq.harvard.edu/> - Harvard University
GaryKing.org - King(a)Harvard.edu - @KingGary <https://twitter.com/kinggary> -
617-500-7570 - Assistant <king-assist(a)iq.harvard.edu>: 617-495-9271
On Mon, May 14, 2018 at 1:46 PM fang zhang <fazhang2000(a)hotmail.com> wrote:
> Hi All,
>
>
> Can someone give me some languages or point me to a paper
> explaining how CEM upweight or downweight a strata?
>
> I know the weight for each case is 1 and the weights of all
> controls adding up to the control's sample size. Some reviewers are asking
> us to give some language to explain the CEM weights for medical audiences.
>
> Thanks a lot!
>
>
> Fang
>