tag:blogger.com,1999:blog-1275149608391671670.post4727552055330360672..comments2023-09-28T06:13:40.704-04:00Comments on SAS and R: Example 7.35: Propensity score matchingKen Kleinmanhttp://www.blogger.com/profile/09525118721291529157noreply@blogger.comBlogger18125tag:blogger.com,1999:blog-1275149608391671670.post-34865671522973563682016-05-13T06:38:31.154-04:002016-05-13T06:38:31.154-04:00I was asked to match 35000 cases to 350 000 contro...I was asked to match 35000 cases to 350 000 controls for an A/B study. Is this feasible using SAS propensity score matching or would other methods be more appropriate given the size of the datasets.<br /><br />Thanks for answering.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1275149608391671670.post-13611081863203091982013-03-05T11:45:31.096-05:002013-03-05T11:45:31.096-05:00Thank you for the SAS macro. Question. The N for t...Thank you for the SAS macro. Question. The N for the cases increases after matching. I have 31 cases, and after a 3 to 1 match, I now have 93 cases. Do I need to delete these duplicate observations for the cases before performing my analysis? My question really concerns the degrees of freedom and standard error for tests comparing the cases and controls after matching. Thanks in advance! Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1275149608391671670.post-3615610876178505192012-08-13T17:14:54.672-04:002012-08-13T17:14:54.672-04:00I would say rather that matching _should_ not be d...I would say rather that matching _should_ not be done. (In these cases logistic regression fitting algorithms should provide some feedback, usually using language about complete or quasi-complete separation. They may not however, and I think that some will generate predicted probabilities (propensities) that might rather misleadingly suggest similar propensities.) <br /><br />A too-casual approach would match regardless of this situation and fail to notice the complete separation. Something to be careful about!<br /><br />In lay terms, I would explain this phenomenon by saying that some kinds of people choose one treatment, and other kinds of people choose the other, so that there are no cases of people with "the same" probability of choosing a given treatment, some of whom choose one and some the other treatment. Since the propensity score approach is motivated by assuming the actual treatment assignment in such cases is random, the propensity score analysis shouldn't be used in this setting.Ken Kleinmanhttps://www.blogger.com/profile/09525118721291529157noreply@blogger.comtag:blogger.com,1999:blog-1275149608391671670.post-20943057984048547062012-08-12T20:07:00.822-04:002012-08-12T20:07:00.822-04:00What happens when the treatment is perfectly predi...What happens when the treatment is perfectly predictable given the covariates? If I am right, in this case, the propensity scores will be far apart and matching cannot be done?greenberet123https://www.blogger.com/profile/01260946486700240220noreply@blogger.comtag:blogger.com,1999:blog-1275149608391671670.post-11101123282553932202012-03-12T22:24:17.616-04:002012-03-12T22:24:17.616-04:00Thanks this website is so helpful and easy to unde...Thanks this website is so helpful and easy to understand <br />In Match(), I suppose p<0.05 means the data is well balanced?monsterworldhttps://www.blogger.com/profile/10135416680962988937noreply@blogger.comtag:blogger.com,1999:blog-1275149608391671670.post-16750961916734985322012-03-05T11:03:23.349-05:002012-03-05T11:03:23.349-05:00Regret I don't have a version that does not us...Regret I don't have a version that does not use proc assign. You might ask the authors, at the Mayo Clinic, if they have such a version.<br /><br />I believe proc assign is part of SAS/OR, though it is no longer documented. (http://support.sas.com/kb/42/143.html) So another solution would be to license the SAS/OR software, or find an installation that includes it.<br /><br />Finally, you could use R to do the matching part of your job-- you can use the proc_r macro (http://sas-and-r.blogspot.com/2012/01/sas-macro-simplifies-sas-and-r.html) to do this smoothly and inside a single SAS program.Ken Kleinmanhttps://www.blogger.com/profile/09525118721291529157noreply@blogger.comtag:blogger.com,1999:blog-1275149608391671670.post-52515772146529580222012-03-04T23:22:40.935-05:002012-03-04T23:22:40.935-05:00Thank you very much for your work.
I got error bec...Thank you very much for your work.<br />I got error because macro vmatch includes "proc assign" using SAS 9.2. Please let me know how to correct your code of vmatch.Tabuchinoreply@blogger.comtag:blogger.com,1999:blog-1275149608391671670.post-45580658897676247082011-07-29T15:52:48.646-04:002011-07-29T15:52:48.646-04:00Ken,
You are right. I should use your modified ve...Ken, <br />You are right. I should use your modified version. Now everything is fine. Thank you!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1275149608391671670.post-84414418487333928982011-07-25T15:51:33.534-04:002011-07-25T15:51:33.534-04:00Are you using the macro from Mayo, or the modified...Are you using the macro from Mayo, or the modified version I posted? I believe that option was added by me.Ken Kleinmanhttps://www.blogger.com/profile/09525118721291529157noreply@blogger.comtag:blogger.com,1999:blog-1275149608391671670.post-39461908595283166982011-07-24T12:44:17.321-04:002011-07-24T12:44:17.321-04:00Hi,
I found this website is very useful and tried...Hi, <br />I found this website is very useful and tried to use the following sas codes you provided in example 7.35, yet, I got an error message in the log. Is there any suggestion that I may be wrong somewhere?<br /><br />%dist(data=prop2, group=homeless, ..., mergeout=mpropen);<br /><br />ERROR: The keyword parameter MERGEOUT was not defined with the macro.<br /><br />Thank you.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1275149608391671670.post-75543400256582469092011-06-15T13:47:33.433-04:002011-06-15T13:47:33.433-04:00Hello, Dong-- Thanks for that information.
I'...Hello, Dong-- Thanks for that information. <br /><br />I'm not sure why you're encountering that error. Can you replicate our results here using the macros at the book web site and the data as generated in example 7.34?Ken Kleinmanhttps://www.blogger.com/profile/09525118721291529157noreply@blogger.comtag:blogger.com,1999:blog-1275149608391671670.post-18949079915712092722011-06-14T20:20:28.884-04:002011-06-14T20:20:28.884-04:00Hello, about propensity weighted regression, there...Hello, about propensity weighted regression, there's a good article on SAS SUGI. It uses PROC SQL and use propensity in weight statement. <br />Just wanted to share that info.<br /><br />Also, I wanted to ask a question on proensity matching. As I used macros, I keep getting this message: <br /><br />ERROR: Variable ID not found.<br /><br />when i correctly specified ID variable in macros. Does anyone have similar experience like this?<br /><br />Thank you.donghttp://ucsd.edunoreply@blogger.comtag:blogger.com,1999:blog-1275149608391671670.post-89861533828431875542011-01-28T16:12:22.167-05:002011-01-28T16:12:22.167-05:00Thanks very much for the book and for the blog.
Y...Thanks very much for the book and for the blog.<br /><br />You mention your appreciation of Rosenbaum's _Design of Observational Studies_ In it, he describes the method of "direct adjustment" to address the challenges of summarizing data from matched studies with variable matching rates. <br /><br />How closely does the use of the WEIGHT statement in SAS approach this method? Does it depend on the PROC?<br /><br />Thanks!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1275149608391671670.post-11272769084974973932010-11-13T23:05:01.974-05:002010-11-13T23:05:01.974-05:00Your book is fantastic and I love the indepth exam...Your book is fantastic and I love the indepth example driven companion website. This is truly service after the sale! Great job!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1275149608391671670.post-74420216207649130872010-10-22T10:33:37.154-04:002010-10-22T10:33:37.154-04:00Thanks, Anonymous. Please do send us questions or...Thanks, Anonymous. Please do send us questions or ideas for entries-- finding suitable and interesting material has been a bigger challenge than we realized.Ken Kleinmanhttps://www.blogger.com/profile/09525118721291529157noreply@blogger.comtag:blogger.com,1999:blog-1275149608391671670.post-82628289767851688792010-10-22T00:53:40.635-04:002010-10-22T00:53:40.635-04:00Hey guys...just to encourage you to keep writing, ...Hey guys...just to encourage you to keep writing, I want you to know that I find this site very useful. I recently migrated to R from Stata.<br />Cheers.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1275149608391671670.post-76807875464498973232010-08-25T17:31:20.921-04:002010-08-25T17:31:20.921-04:00Unfortunately, we aren't able to give specific...Unfortunately, we aren't able to give specific advice for your problem, as there's not one right answer as to how to undertake your analysis. I'm a bit fan of Paul Rosenbaum's <a href="http://www.amazon.com/Design-Observational-Studies-Springer-Statistics/dp/1441912126/ref=sr_1_8?ie=UTF8&s=books&qid=1282771749&sr=8-8" rel="nofollow">Design of Observational Studies"</a> book, which may be useful to consult.Nick Hortonhttps://www.blogger.com/profile/00242216324355342047noreply@blogger.comtag:blogger.com,1999:blog-1275149608391671670.post-5040766368207140422010-08-25T13:39:35.654-04:002010-08-25T13:39:35.654-04:00I am a new learner on statistics and I followed he...I am a new learner on statistics and I followed here from reading your great book.<br /><br />I am comparing the average number of emergency visits between the people who enrolled in a program with the people who are not enrolled in. <br /><br />My covariates include age, gender, sex, Risk score, number of emergency visits before the program, …<br /><br />I followed your examples for the propensity score and the match. I also did the t-test with unequal variance for the continuous covariates between the two samples before the match and did the t-test with equal variance test for the covariates after the match.<br /><br />Should I use the paired t-test to test the effectiveness of the program(the average number of emergency visits between the people who enrolled in a program and the people who are not enrolled in)?<br /><br />Once again, thank you very much!Anonymousnoreply@blogger.com