<?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: How to run the SAS macro of Net Reclassification Index in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-run-the-SAS-macro-of-Net-Reclassification-Index/m-p/936007#M367951</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/382088"&gt;@SeaMoon_168&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;(...) However, I still cannot run the code.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/382088"&gt;@SeaMoon_168&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think it will help if we are using the same test data. Using the &lt;FONT face="courier new,courier"&gt;Myeloma&lt;/FONT&gt; dataset from &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/statug/statug_phreg_examples01.htm" target="_blank" rel="noopener"&gt;Example 92.1 of the PROC PHREG documentation&lt;/A&gt; I obtained seemingly reasonable results and a clean log with the code below including calls of the two macros contained in your attachment NRI.sas:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Create subject ID */

data one;
set Myeloma;
_id_=_n_;
run;

/* Set (arbitrary) reference values for predictor variables */

proc summary data=one;
var LogBUN--SCalc;
output out=ref(drop=_:) min=;
run;

/* Create the "dummy observation" as suggested in NRI.sas and set the time point of interest */

data two;
_id_=0;
VStatus=.;
Time=10;
set ref;
run;

/* Create input dataset for macro PREDMAC */

data have;
set two one;
run;

/* Call macro PREDMAC with two different Cox models and save the predicted event probabilities */

%PREDMAC(have, _id_, VStatus, Death, Time, Platelet Frac, HGB Platelet Age LogWBC Frac LogPBM Protein SCalc, Base model, probt1)

data mod1;
set preddat;
run;

%PREDMAC(have, _id_, VStatus, Death, Time, Platelet Frac, LogBUN HGB Platelet Age LogWBC Frac LogPBM Protein SCalc, Extended model, probt2)

data mod2;
set preddat;
run;

/* Create input dataset for macro SURV_CONTNRI */

data combo;
merge mod1(keep=_id_ VStatus Time probt1)
      mod2(keep=_id_ probt2);
by _id_;
run;

/* Estimate NRI among other statistics */

%SURV_CONTNRI(combo,2,VStatus,Time,10,probt1,probt2)
/* Result: NRI=0.43560597682792335 */&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 17 Jul 2024 10:36:29 GMT</pubDate>
    <dc:creator>FreelanceReinh</dc:creator>
    <dc:date>2024-07-17T10:36:29Z</dc:date>
    <item>
      <title>How to run the SAS macro of Net Reclassification Index</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-run-the-SAS-macro-of-Net-Reclassification-Index/m-p/935041#M367641</link>
      <description>&lt;P&gt;I am doing a Net Reclassification Index (NRI) analysis to compare two Cox PH models. I found a SAS NRI macro from&amp;nbsp;&lt;A href="https://ncook.bwh.harvard.edu/assets/survmacs.v4.sas" target="_blank"&gt;https://ncook.bwh.harvard.edu/assets/survmacs.v4.sas&lt;/A&gt;. I used&amp;nbsp;SURV_CONTNRI of these macros. However, my SAS code did not work. The code was attached. Could you help me figure it out? Many thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2024 20:01:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-run-the-SAS-macro-of-Net-Reclassification-Index/m-p/935041#M367641</guid>
      <dc:creator>SeaMoon_168</dc:creator>
      <dc:date>2024-07-08T20:01:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to run the SAS macro of Net Reclassification Index</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-run-the-SAS-macro-of-Net-Reclassification-Index/m-p/935091#M367654</link>
      <description>&lt;P&gt;"Did not work" is awful vague.&lt;BR /&gt;&lt;BR /&gt;Are there errors in the log?: Post the code and log in a code box opened with the "&amp;lt;/&amp;gt;" to maintain formatting of error messages.&lt;BR /&gt;&lt;BR /&gt;No output? Post any log in a code box.&lt;BR /&gt;&lt;BR /&gt;Unexpected output? Provide input data in the form of data step code pasted into a code box, the actual results and the expected results. Instructions here: &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt; will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the "&amp;lt;/&amp;gt;" icon or attached as text to show exactly what you have and that we can test code against.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since your issue involves macro code then you would want to set:&lt;/P&gt;
&lt;P&gt;Options MPRINT;&lt;/P&gt;
&lt;P&gt;before executing the code. That option will send the resolved created code to the log in much more detail and have any warnings or errors appear in better relationship to the code generating them.&lt;/P&gt;
&lt;P&gt;Set Options nomprint; to reset to default.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One thing that bothers me a bit is multiple uses of the *text; style comments. In some situations such can be treated as executable code inside a macro. To use statement style comments in a macro the line should be prefaced with an % as in %* text;&amp;nbsp; Or use the /* text */ style comment.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2024 04:44:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-run-the-SAS-macro-of-Net-Reclassification-Index/m-p/935091#M367654</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-07-09T04:44:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to run the SAS macro of Net Reclassification Index</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-run-the-SAS-macro-of-Net-Reclassification-Index/m-p/935168#M367693</link>
      <description>&lt;P&gt;Thank you for your advice. The log was attached. Could you help me figure out what is wrong with my SAS code?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2024 15:19:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-run-the-SAS-macro-of-Net-Reclassification-Index/m-p/935168#M367693</guid>
      <dc:creator>SeaMoon_168</dc:creator>
      <dc:date>2024-07-09T15:19:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to run the SAS macro of Net Reclassification Index</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-run-the-SAS-macro-of-Net-Reclassification-Index/m-p/935173#M367696</link>
      <description>&lt;P&gt;The problem why you get no output comes from this step:&lt;/P&gt;
&lt;PRE&gt;232  %SURV_CONTNRI(newdata,2,status,time,4,surv1,surv2);
MPRINT(SURV_CONTNRI):   title2 Continuous NRI for Event status at Time 4 : surv2 vs surv1 ;
MPRINT(SURV_CONTNRI):   title3 "Need to Bootstrap for SE";
MPRINT(SURV_CONTNRI):   data nri1;
MPRINT(SURV_CONTNRI):   set newdata;
MPRINT(SURV_CONTNRI):   _id_=_N_;
MPRINT(SURV_CONTNRI):   * compute diffs in probs;
MPRINT(SURV_CONTNRI):   event=status;
MPRINT(SURV_CONTNRI):   pyrs=time;
MPRINT(SURV_CONTNRI):   prob1=surv1;
MPRINT(SURV_CONTNRI):   prob2=surv2;
MPRINT(SURV_CONTNRI):   diffp=prob2-prob1;
MPRINT(SURV_CONTNRI):   if prob1&amp;gt;. and prob2&amp;gt;.;
MPRINT(SURV_CONTNRI):   keep _id_ event pyrs prob1 prob2 diffp;
MPRINT(SURV_CONTNRI):   run;

&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;NOTE: Variable surv1 is uninitialized.
NOTE: Variable surv2 is uninitialized.

&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/PRE&gt;
&lt;P&gt;When those two variables are uninitialized then the values are missing for Prob1 and Prob2 so no output records are written.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your call to this macro is using your just created data set NEWDATA from proc import and it does not contain variables Surv1 or Surv2.&lt;/P&gt;
&lt;P&gt;I don't see very much documentation on these macros, such as what Prob1 or Prob2 are supposed to look like but with descriptions like : PROB1 = probability for model 1 look like they are supposed to hold output from a model, possibly that proc phreg output but I can't say as there is no documentation of that. I would &lt;STRONG&gt;guess&lt;/STRONG&gt; that there is a step or two that you are supposed to do that generates those model probabilities and likely combines some data sets somewhere to have the output probabilities for two separate models in one data set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sometimes people write these so that the output of one macro is used as the input to another but I can't tell if that is the case here or what other steps are needed to make your raw data usable for these macros.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;IF your raw data is supposed to be usable with these macros then you need to determine which variables in the data set align with the macro. Perhaps DM1 is supposed to be Prob1 and DM2 is supposed to be Prob2.&lt;/P&gt;
&lt;P&gt;Note that the Proc import step has these variables:&lt;/P&gt;
&lt;P&gt;VAR1 $&lt;BR /&gt;time&lt;BR /&gt;status&lt;BR /&gt;DM1&lt;BR /&gt;DM2&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Good luck.&lt;/P&gt;
&lt;P&gt;As an aside, I wouldn't say your code is particularly "wrong" but that the author of the macros was more than a little obtuse about providing exactly what the input data set(s) for these should look like.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2024 15:55:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-run-the-SAS-macro-of-Net-Reclassification-Index/m-p/935173#M367696</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-07-09T15:55:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to run the SAS macro of Net Reclassification Index</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-run-the-SAS-macro-of-Net-Reclassification-Index/m-p/935858#M367908</link>
      <description>&lt;P&gt;Thank you for your help. I made some changes from another expert. A new SAS macro was added named "%macro SURV_CONTNRI(DSNAME,DETAIL,EVENT,PYRS,T,PROB1,PROB2)". The SAS macro about generating surv1 and surv2 that are the probability of the Cox models. However, I still cannot run the code. It seems they create a matrix to store variables and then use Cox PH model? but I cannot fully understand all the code. Could anyone help me figure it out?&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jul 2024 19:40:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-run-the-SAS-macro-of-Net-Reclassification-Index/m-p/935858#M367908</guid>
      <dc:creator>SeaMoon_168</dc:creator>
      <dc:date>2024-07-15T19:40:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to run the SAS macro of Net Reclassification Index</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-run-the-SAS-macro-of-Net-Reclassification-Index/m-p/935927#M367923</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/382088"&gt;@SeaMoon_168&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thank you for your help. I made some changes from another expert. A new SAS macro was added named "%macro SURV_CONTNRI(DSNAME,DETAIL,EVENT,PYRS,T,PROB1,PROB2)". The SAS macro about generating surv1 and surv2 that are the probability of the Cox models. However, I still cannot run the code. It seems they create a matrix to store variables and then use Cox PH model? but I cannot fully understand all the code. Could anyone help me figure it out?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If the output of that Surv_contnri is supposed to be the input for the net reclassification then you need to make sure that Surv_contnri runs properly and the log you posted shows that either your call to the macro using variables not in the data set is incorrect or the input data set is incorrect for that macro. Until you get that running properly, again assuming it is supposed to create the input for the other macro, that is your bottleneck.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jul 2024 13:58:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-run-the-SAS-macro-of-Net-Reclassification-Index/m-p/935927#M367923</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-07-16T13:58:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to run the SAS macro of Net Reclassification Index</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-run-the-SAS-macro-of-Net-Reclassification-Index/m-p/936007#M367951</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/382088"&gt;@SeaMoon_168&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;(...) However, I still cannot run the code.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/382088"&gt;@SeaMoon_168&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think it will help if we are using the same test data. Using the &lt;FONT face="courier new,courier"&gt;Myeloma&lt;/FONT&gt; dataset from &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/statug/statug_phreg_examples01.htm" target="_blank" rel="noopener"&gt;Example 92.1 of the PROC PHREG documentation&lt;/A&gt; I obtained seemingly reasonable results and a clean log with the code below including calls of the two macros contained in your attachment NRI.sas:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Create subject ID */

data one;
set Myeloma;
_id_=_n_;
run;

/* Set (arbitrary) reference values for predictor variables */

proc summary data=one;
var LogBUN--SCalc;
output out=ref(drop=_:) min=;
run;

/* Create the "dummy observation" as suggested in NRI.sas and set the time point of interest */

data two;
_id_=0;
VStatus=.;
Time=10;
set ref;
run;

/* Create input dataset for macro PREDMAC */

data have;
set two one;
run;

/* Call macro PREDMAC with two different Cox models and save the predicted event probabilities */

%PREDMAC(have, _id_, VStatus, Death, Time, Platelet Frac, HGB Platelet Age LogWBC Frac LogPBM Protein SCalc, Base model, probt1)

data mod1;
set preddat;
run;

%PREDMAC(have, _id_, VStatus, Death, Time, Platelet Frac, LogBUN HGB Platelet Age LogWBC Frac LogPBM Protein SCalc, Extended model, probt2)

data mod2;
set preddat;
run;

/* Create input dataset for macro SURV_CONTNRI */

data combo;
merge mod1(keep=_id_ VStatus Time probt1)
      mod2(keep=_id_ probt2);
by _id_;
run;

/* Estimate NRI among other statistics */

%SURV_CONTNRI(combo,2,VStatus,Time,10,probt1,probt2)
/* Result: NRI=0.43560597682792335 */&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jul 2024 10:36:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-run-the-SAS-macro-of-Net-Reclassification-Index/m-p/936007#M367951</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2024-07-17T10:36:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to run the SAS macro of Net Reclassification Index</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-run-the-SAS-macro-of-Net-Reclassification-Index/m-p/936250#M368037</link>
      <description>&lt;P&gt;Many thanks. Your code worked well with the Myeloma data. However, it did not work using my own data. I attached my data and simply compare base model: DM1 and extended model: DM1 DM2. Could you help me figure it out?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2024 17:50:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-run-the-SAS-macro-of-Net-Reclassification-Index/m-p/936250#M368037</guid>
      <dc:creator>SeaMoon_168</dc:creator>
      <dc:date>2024-07-18T17:50:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to run the SAS macro of Net Reclassification Index</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-run-the-SAS-macro-of-Net-Reclassification-Index/m-p/936322#M368059</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/382088"&gt;@SeaMoon_168&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Many thanks. Your code worked well with the Myeloma data. However, it did not work using my own data. I attached my data and simply compare base model: DM1 and extended model: DM1 DM2. Could you help me figure it out?&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You're welcome. Not sure what exactly "did not work" on your side without seeing your code, log or output. But here is the code that does work with your sample data (which I read into a work dataset SAMPLE from a CSV file created from your Excel file on my private computer, as there is no Excel on my SAS workstation) with the changes highlighted in bold:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;FONT color="#808080"&gt;/* Create subject ID */

data one;
set &lt;FONT color="#000000"&gt;&lt;STRONG&gt;sample&lt;/STRONG&gt;&lt;/FONT&gt;;
_id_=_n_;
run;

/* Set (arbitrary) reference values for predictor variables */

proc summary data=one;
var &lt;FONT color="#000000"&gt;&lt;STRONG&gt;DM:&lt;/STRONG&gt;&lt;/FONT&gt;;
output out=ref(drop=_:) min=;
run;

/* Create the "dummy observation" as suggested in NRI.sas and set the time point of interest */

data two;
_id_=0;
VStatus=.;
Time=&lt;FONT color="#000000"&gt;&lt;STRONG&gt;2.5&lt;/STRONG&gt;&lt;/FONT&gt;;
set ref;
run;

/* Create input dataset for macro PREDMAC */

data have;
set two one;
run;

/* Call macro PREDMAC with two different Cox models and save the predicted event probabilities */

%PREDMAC(have, _id_, VStatus, Death, Time, &lt;FONT color="#000000"&gt;&lt;STRONG&gt;DM1&lt;/STRONG&gt;&lt;/FONT&gt;, &lt;STRONG&gt;&lt;FONT color="#000000"&gt;DM1&lt;/FONT&gt;&lt;/STRONG&gt;, Base model, probt1)

data mod1;
set preddat;
run;

%PREDMAC(have, _id_, VStatus, Death, Time, &lt;FONT color="#000000"&gt;&lt;STRONG&gt;DM1 DM2&lt;/STRONG&gt;&lt;/FONT&gt;, &lt;FONT color="#000000"&gt;&lt;STRONG&gt;DM1 DM2&lt;/STRONG&gt;&lt;/FONT&gt;, Extended model, probt2)

data mod2;
set preddat;
run;

/* Create input dataset for macro SURV_CONTNRI */

data combo;
merge mod1(keep=_id_ VStatus Time probt1)
      mod2(keep=_id_ probt2);
by _id_;
run;

/* Estimate NRI among other statistics */

%SURV_CONTNRI(combo,2,VStatus,Time,&lt;FONT color="#000000"&gt;&lt;STRONG&gt;2.5&lt;/STRONG&gt;&lt;/FONT&gt;,probt1,probt2)&lt;/FONT&gt;&lt;/PRE&gt;
&lt;P&gt;The main result is &lt;FONT face="courier new,courier"&gt;nri=0.30344&lt;/FONT&gt;... It depends, however, on whether variable DM1 (with values 0, 1, 2, 3) is treated as a CLASS variable by PROC PHREG (as above). If it is treated as a &lt;EM&gt;continuous&lt;/EM&gt; variable, I obtain&amp;nbsp;&lt;FONT face="courier new,courier"&gt;nri=0.26082&lt;/FONT&gt;... with the PREDMAC macro calls changed to&lt;/P&gt;
&lt;PRE&gt;&lt;FONT color="#808080"&gt;%PREDMAC(have, _id_, VStatus, Death, Time, , &lt;STRONG&gt;&lt;FONT color="#000000"&gt;DM1&lt;/FONT&gt;&lt;/STRONG&gt;, Base model, probt1)

...

%PREDMAC(have, _id_, VStatus, Death, Time, &lt;STRONG&gt;&lt;FONT color="#000000"&gt;DM2&lt;/FONT&gt;&lt;/STRONG&gt;, &lt;STRONG&gt;&lt;FONT color="#000000"&gt;DM1 DM2&lt;/FONT&gt;&lt;/STRONG&gt;, Extended model, probt2)&lt;/FONT&gt;&lt;/PRE&gt;
&lt;P&gt;As expected, treating DM2 (with values 0, 1) as a continuous variable (i.e., leaving the CLASSVARS parameter of macro PREDMAC blank also in the second call) makes no difference.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jul 2024 10:37:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-run-the-SAS-macro-of-Net-Reclassification-Index/m-p/936322#M368059</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2024-07-19T10:37:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to run the SAS macro of Net Reclassification Index</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-run-the-SAS-macro-of-Net-Reclassification-Index/m-p/936426#M368079</link>
      <description>&lt;P&gt;Many thanks! The code worked for my data now. However, the results using the SAS code is not the same as the results using the R package-survIDINRI :-(. I have no idea if the authors of these two used the same method to calculate NRI?&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jul 2024 19:46:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-run-the-SAS-macro-of-Net-Reclassification-Index/m-p/936426#M368079</guid>
      <dc:creator>SeaMoon_168</dc:creator>
      <dc:date>2024-07-19T19:46:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to run the SAS macro of Net Reclassification Index</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-run-the-SAS-macro-of-Net-Reclassification-Index/m-p/936507#M368102</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/382088"&gt;@SeaMoon_168&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;(...) However, the results using the SAS code is not the same as the results using the R package-survIDINRI :-(. I have no idea if the authors of these two used the same method to calculate NRI?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The &lt;A href="https://cran.r-project.org/web/packages/survIDINRI/survIDINRI.pdf" target="_blank" rel="noopener"&gt;documentation of the survIDINRI package&lt;/A&gt; contains a reference&amp;nbsp;&lt;EM&gt;Pencina et al.(2011)&lt;/EM&gt; and states that the "Result of continuous-NRI", denoted&amp;nbsp;&lt;FONT face="courier new,courier"&gt;m2&lt;/FONT&gt;, "corresponds to the quantity defined as '1/2 NRI(&amp;gt;0)'" in that article. (Without delving into the R code it is not quite clear to me whether this means &lt;FONT face="courier new,courier"&gt;m2&lt;/FONT&gt;=1/2 NRI(&amp;gt;0) or rather &lt;FONT face="courier new,courier"&gt;m2&lt;/FONT&gt;=NRI(&amp;gt;0).) The definition of that NRI(&amp;gt;0), in turn, is consistent with the algorithm used in the SAS macros from Harvard, as far as I see, -- &lt;EM&gt;except&lt;/EM&gt; that the survival probabilities in the article are "all estimated using the Kaplan-Meier approach" (&lt;EM&gt;Pencina et al.(2011)&lt;/EM&gt;), whereas current SAS/STAT versions &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/statug/statug_phreg_syntax18.htm#statug.phreg.phroutputmethod" target="_blank" rel="noopener"&gt;use METHOD=BRESLOW by default&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, other than the potential trivial discrepancy due to the factor 1/2 mentioned above, you should check if adding the option METHOD=PL to the OUTPUT statements of the two PROC PHREG steps in macro SURV_CONTNRI helps to match the result from R. That is:&lt;/P&gt;
&lt;PRE&gt;&lt;FONT color="#808080"&gt;proc phreg data=_all_(where=(disc=1 or disc=-1)) noprint;
   model pyrs*event(0) =  ;
   id _id_;
   strata disc;
   output out=survdat survival=_survest_ &lt;FONT color="#000000"&gt;&lt;STRONG&gt;/ method=pl&lt;/STRONG&gt;&lt;/FONT&gt;;
run;

proc phreg data=_all_(where=(bd ne 1)) noprint;
   model pyrs*event(0) =  ;
   id _id_;
   output out=survdat0 survival=survall &lt;FONT color="#000000"&gt;&lt;STRONG&gt;/ method=pl&lt;/STRONG&gt;&lt;/FONT&gt;;
run;&lt;/FONT&gt;&lt;/PRE&gt;
&lt;P&gt;Also, are you aware that the NRI statistic is rather questionable (according to what I've read in the past few days)? Even the Wikipedia page&amp;nbsp;&lt;A href="https://en.wikipedia.org/wiki/Net_reclassification_improvement" target="_blank" rel="noopener"&gt;Net reclassification improvement&lt;/A&gt; says, "NRI has been demonstrated to be invalid."&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jul 2024 19:39:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-run-the-SAS-macro-of-Net-Reclassification-Index/m-p/936507#M368102</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2024-07-20T19:39:05Z</dc:date>
    </item>
  </channel>
</rss>

