<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Error in Propensity score Matching macro in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Error-in-Propensity-score-Matching-macro/m-p/110010#M5810</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tom,&lt;/P&gt;&lt;P&gt;I verified the macro, restarted SAS. and tried to run it again, but now it shows me some more errors.&lt;/P&gt;&lt;P&gt;I have attached the error log to the original post.&lt;/P&gt;&lt;P&gt;I am also attaching the SAS code to run the macro and how I have modified the SAS code ..&lt;/P&gt;&lt;P&gt;Would you please take a look at the SAS code and the error log and let me know if the SAS code, I have modified, is correct and why I am getting those errors? That would be a great help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 18 Jun 2013 18:53:02 GMT</pubDate>
    <dc:creator>Ashwini_uci</dc:creator>
    <dc:date>2013-06-18T18:53:02Z</dc:date>
    <item>
      <title>Error in Propensity score Matching macro</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Error-in-Propensity-score-Matching-macro/m-p/110006#M5806</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Andalus','serif'; color: #3c2fe9;"&gt;Hello,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Andalus','serif'; color: #3c2fe9;"&gt;This question is for those with expertise in PSM analyses and macro.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Andalus','serif'; color: #3c2fe9;"&gt;I have been working on this propensity Score matching analyses for the first time and found a paper that provides a macro for PSM, attached below. &lt;SPAN style="color: #3c2fe9; font-family: Andalus, serif;"&gt;The paper&amp;nbsp; provides the SAS code and the Macro which I am trying to run.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Andalus','serif'; color: #3c2fe9;"&gt;I have started working on the macro and creating all required variables. I am following all the steps given in this paper.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Andalus','serif'; color: #3c2fe9;"&gt;But in the last step, when I try to run the macro, the log shows me following error; I do not know about macros and I cannot really locate or identify any error, if there is any.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: red; background: white;"&gt;ERROR: The keyword parameter PAT_PSVAR was not defined with the macro.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3c2fe9; font-family: Andalus, serif;"&gt;Appreciate if you would please take a look at the macro and check if this variable is defined in the macro or if I am doing anything wrong, and if the variable is not defined in the macro, can you help me define it.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3c2fe9; font-family: Andalus, serif;"&gt;Has anyone referred to this paper to perform PSM analyses? &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Andalus','serif'; color: #3c2fe9;"&gt;Is there any other simple way to perform the PSM analyses for someone like who who is not familiar with macros at all?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Andalus','serif'; color: #3c2fe9;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3c2fe9; font-family: Andalus, serif;"&gt;Any advice/help/guidance would be highly appreciated!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3c2fe9; font-family: Andalus, serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Andalus','serif'; color: #3c2fe9;"&gt;Thanks much!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Andalus','serif'; color: #3c2fe9;"&gt;Ashwini&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jun 2013 00:11:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Error-in-Propensity-score-Matching-macro/m-p/110006#M5806</guid>
      <dc:creator>Ashwini_uci</dc:creator>
      <dc:date>2013-06-18T00:11:52Z</dc:date>
    </item>
    <item>
      <title>Re: Error in Propensity score Matching macro</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Error-in-Propensity-score-Matching-macro/m-p/110007#M5807</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looking at the code in PDF file you attached I can see that PAT_PSVAR is definitely intended to be defined as a parameter.&lt;/P&gt;&lt;P&gt;But notice that the second line is missing the slash to end the in-line comment.&amp;nbsp; This will have the effect of "eating" the third line which is where PAT_PSVAR is defined.&lt;/P&gt;&lt;P&gt;Corrected %macro statement is below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%macro psmatch_multi(pat_dsn =, /* Name of data set with patient data */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;pat_idvar=, /* Name of Patient ID variable in data set &amp;amp;PAT_DSN *&lt;SPAN style="color: #ff0000;"&gt;/&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;pat_psvar=, /* Name of Propensity Score variable in data set &amp;amp;PAT_DSN */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;cntl_dsn=, /* Name of data set with control data */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;cntl_idvar=, /* Name of Control ID variable in data set &amp;amp;CNTL_DSN */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;cntl_psvar=, /* Name of Propensity Score variable in data set &amp;amp;CNTL_DSN */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;match_dsn=, /* Name of output data set with N:1 matches */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;match_ratio=, /* Number of control matches per patient */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;score_diff=, /* Maximum allowable absolute differences between propensity scores*/&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;seed=1234567890) /* Optional input seed for random number generator */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jun 2013 00:27:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Error-in-Propensity-score-Matching-macro/m-p/110007#M5807</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-06-18T00:27:43Z</dc:date>
    </item>
    <item>
      <title>Re: Error in Propensity score Matching macro</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Error-in-Propensity-score-Matching-macro/m-p/110008#M5808</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 12.800000190734863px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-family: Andalus, serif; color: #3c2fe9;"&gt;Hi!, Thanks for your help. I did correct that in the macro, but still it shows the same warning..&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12.800000190734863px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-family: Andalus, serif; color: #3c2fe9;"&gt;Maybe there's something missing in the actual macro, I mean inside those loops..&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12.800000190734863px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-family: Andalus, serif; color: #3c2fe9;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jun 2013 01:05:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Error-in-Propensity-score-Matching-macro/m-p/110008#M5808</guid>
      <dc:creator>Ashwini_uci</dc:creator>
      <dc:date>2013-06-18T01:05:06Z</dc:date>
    </item>
    <item>
      <title>Re: Error in Propensity score Matching macro</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Error-in-Propensity-score-Matching-macro/m-p/110009#M5809</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could be, but the error message was very specific that it was because the parameter was not defined.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Make sure you have not introduced un wanted semi-colons into the modified code.&amp;nbsp; The code I posted above is one statement so there should only be one semi-colon.&amp;nbsp; Also make sure you do not have multiple copies of the macro definition or un wanted %MACRO statements that might be re-defining the macro.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You also might want to close SAS and start over so that you can eliminate to possibility that because of the unbalanced comment blocks you have gotten SAS confused about what is code and what is comment or what is macro definition and what are calls.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jun 2013 01:19:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Error-in-Propensity-score-Matching-macro/m-p/110009#M5809</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-06-18T01:19:28Z</dc:date>
    </item>
    <item>
      <title>Re: Error in Propensity score Matching macro</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Error-in-Propensity-score-Matching-macro/m-p/110010#M5810</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tom,&lt;/P&gt;&lt;P&gt;I verified the macro, restarted SAS. and tried to run it again, but now it shows me some more errors.&lt;/P&gt;&lt;P&gt;I have attached the error log to the original post.&lt;/P&gt;&lt;P&gt;I am also attaching the SAS code to run the macro and how I have modified the SAS code ..&lt;/P&gt;&lt;P&gt;Would you please take a look at the SAS code and the error log and let me know if the SAS code, I have modified, is correct and why I am getting those errors? That would be a great help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jun 2013 18:53:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Error-in-Propensity-score-Matching-macro/m-p/110010#M5810</guid>
      <dc:creator>Ashwini_uci</dc:creator>
      <dc:date>2013-06-18T18:53:02Z</dc:date>
    </item>
    <item>
      <title>Re: Error in Propensity score Matching macro</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Error-in-Propensity-score-Matching-macro/m-p/110011#M5811</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The error message is because the variable name you gave the macro was not on the dataset you gave it.&amp;nbsp; Sounds more like a mixup in your call than in the macro itself.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;25 The SAS System 18:31 Monday, June 17, 2013&lt;/P&gt;&lt;P&gt;ERROR: Column pat_id could not be found in the table/view identified with the correlation name P.&lt;/P&gt;&lt;P&gt;ERROR: Column pat_id could not be found in the table/view identified with the correlation name P.&lt;/P&gt;&lt;P&gt;ERROR: Column pat_id could not be found in the table/view identified with the correlation name C.&lt;/P&gt;&lt;P&gt;ERROR: Column pat_id could not be found in the table/view identified with the correlation name C.&lt;/P&gt;&lt;P&gt;NOTE: PROC SQL set option NOEXEC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once it has that error the rest of the macro will fail because the dataset was not created.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is hard to tell how that might have happened from the log you pasted as it is missing the first 24 pages.&amp;nbsp; The MPRINT option is a good way to see the code that the macro has generated and makes the LOG easier to read.&amp;nbsp; It should be easier to see where the macro is generating the wrong code with MPRINT turned on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are a number of places where there are opening /* comments without matching */ to end them.&amp;nbsp; &lt;/P&gt;&lt;P&gt;You should avoid using /* */ comments.&amp;nbsp; The only place I use them is when I want to embed a comment in the middle of a single statement such as in the %MACRO statement or in a really long comment block at the top of a program so that I can paste in actual example usage code with semi-colons.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jun 2013 00:12:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Error-in-Propensity-score-Matching-macro/m-p/110011#M5811</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-06-19T00:12:37Z</dc:date>
    </item>
  </channel>
</rss>

