<?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: Output out options to visualize model results in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Output-out-options-to-visualize-model-results/m-p/571275#M18412</link>
    <description>Hi:&lt;BR /&gt;  I moved the post from where you put it originally into the Graphics forum, since it seemed that most of your questions were graph-related and you'd get more attention in the Graphics Forum.&lt;BR /&gt;&lt;BR /&gt;  I am not a stat instructor, my strengths are reporting and ODS.&lt;BR /&gt;&lt;BR /&gt;  If you want PDF results, then you need some ODS PDF statements. You seem to have at least one ODS OUTPUT statement for parameter estimates from PROC GENMOD. If you need parameter estimates from PROC PHREG, then you need to look at the PHREG documentation and find out which output object contains parameter estimates. The PHREG doc is here: &lt;A href="https://go.documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_phreg_syntax18.htm&amp;amp;docsetVersion=15.1&amp;amp;locale=en" target="_blank"&gt;https://go.documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_phreg_syntax18.htm&amp;amp;docsetVersion=15.1&amp;amp;locale=en&lt;/A&gt; -- it looks like you're right that RESMART contains the Martingale residual -- if you want those  in a separate dataset, then you've got to have an ODS OUTPUT statement for RESMART.&lt;BR /&gt;&lt;BR /&gt;  I didn't see PROC PHREG in your posted code.&lt;BR /&gt;&lt;BR /&gt;Cynthia</description>
    <pubDate>Thu, 04 Jul 2019 19:33:12 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2019-07-04T19:33:12Z</dc:date>
    <item>
      <title>Output out options to visualize model results</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Output-out-options-to-visualize-model-results/m-p/571082#M18408</link>
      <description>&lt;P&gt;Hi folks:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp; &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/462"&gt;@PGStats&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;I'm trying to visualize the relationship between follow-up time (fu) on x-axis and excess hazard ratio also known as relative excess risk on y-axis by disease stage. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Desired plot. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="STAGE BY 52 WEEKS.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/30738i5632588127A5BADC/image-size/large?v=v2&amp;amp;px=999" role="button" title="STAGE BY 52 WEEKS.png" alt="STAGE BY 52 WEEKS.png" /&gt;&lt;/span&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;The poisson model in the SAS code estimates relative excess risks. I output parameter estimates to a dataset and exponentiated parameter estimates using Dr. Dickman's approach.&amp;nbsp; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&lt;A href="http://www.pauldickman.com/survival/sas/relative_survival_using_sas.pdf" target="_blank" rel="noopener"&gt;http://www.pauldickman.com/survival/sas/relative_survival_using_sas.pdf&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;I then plotted exponentiated parameter estimates against the follow-up time grouped by 'stage'. This resulted in the busy plot as shown below.&amp;nbsp; &lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods graphics/width=10in height=3in;
proc sgplot data=parmest;
series x=level1 y=rer /group=stage; 
title 'Excess relative risk by stage, 52 week follow-up';
yaxis label='excess relative risk';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="plot_seesaw.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/30745i35FC886CAD0C66CE/image-size/large?v=v2&amp;amp;px=999" role="button" title="plot_seesaw.png" alt="plot_seesaw.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;However, the smooth flow line on the plot I want appears to have been produced on the all-record data rather a summary data.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;I also, attempted to use effectplot option and got this error from the code below. I'm using SAS 9.4 TS Level 1M5. &lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&lt;FONT color="#FF6600"&gt;NOTE: Algorithm converged.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;NOTE: The scale parameter was held fixed.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;ERROR: Variable configuration is not currently supported by the EFFECTPLOT statement.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;ods output parameterestimates=parmest(WHERE=(PARAMETER IN ('fu'))); /* parameter estimates */
proc genmod data=individ order=formatted;
fwdlink link = log(_MEAN_-d_star);
invlink ilink= exp(_XBETA_)+d_star;
class stage;
model d = fu age stage/ error=poisson offset=ln_y type3;
output out=colon.out(keep=xb agegrp fu range stage)  xbeta=xb; 
effectplot /clm moff; 
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Variable 'age' is continuous and 'stage' is categorical with 4 levels. 'fu' has 52 levels for 52 weeks of calendar year which is a follow-up interval in this context.&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below is my full code and mock data attached to the post.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods output parameterestimates=parmest;
proc genmod data=have order=formatted;
title3 'Main effects model (first 52 week follow-up, age adjusted, stratified by stage)';
by stage; 
fwdlink link = log(_MEAN_-d_star);
invlink ilink= exp(_XBETA_)+d_star;
class fu;
model d = fu age / error=poisson offset=ln_y type3;
output out=colon.out(keep=xb agegrp fu range stage)  xbeta=xb; 
run;&lt;BR /&gt;
ods output close;
data parmest; set parmest;
if df gt 0 then do;
rer=exp(estimate);
low_rer=exp(estimate-1.96*stderr);
hi_rer=exp(estimate+1.96*stderr);
end;
run;

proc print data=parmest label noobs;
title4 'Estimates for beta and relative excess risks (RER=exp(beta))';
    id parameter; by parameter notsorted;
    var level1 estimate stderr rer low_rer hi_rer;
    format estimate stderr rer low_rer hi_rer 6.3;
    label
        parameter='Parameter'
        level1='Level'
        estimate='Estimate'
        stderr='Standard Error'
        rer='Estimated RER'
        low_rer='Lower limit 95% CI'
        hi_rer='Upper limit 95% CI';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;I'll greatly appreciate your insights on what output methods would help construct the desired plot? &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Thanks in advance. Sample data is attached to this post.&amp;nbsp; &lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2019 00:25:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Output-out-options-to-visualize-model-results/m-p/571082#M18408</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2019-07-04T00:25:31Z</dc:date>
    </item>
    <item>
      <title>Re: Output out options to visualize model results</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Output-out-options-to-visualize-model-results/m-p/571260#M18411</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13549"&gt;@Cynthia_sas&lt;/a&gt; notification says that you responded to my post. But I couldn't find your comment. I was curious what you would have to say to resolving this problem? I've been reading PROC PHREG output out options. Specifically about outputting martingale residual defining in resmart option. I still am not clear which output dataset contains parameter estimates for all records to be plotted against the follow-up time.&amp;nbsp; &lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2019 16:19:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Output-out-options-to-visualize-model-results/m-p/571260#M18411</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2019-07-04T16:19:51Z</dc:date>
    </item>
    <item>
      <title>Re: Output out options to visualize model results</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Output-out-options-to-visualize-model-results/m-p/571275#M18412</link>
      <description>Hi:&lt;BR /&gt;  I moved the post from where you put it originally into the Graphics forum, since it seemed that most of your questions were graph-related and you'd get more attention in the Graphics Forum.&lt;BR /&gt;&lt;BR /&gt;  I am not a stat instructor, my strengths are reporting and ODS.&lt;BR /&gt;&lt;BR /&gt;  If you want PDF results, then you need some ODS PDF statements. You seem to have at least one ODS OUTPUT statement for parameter estimates from PROC GENMOD. If you need parameter estimates from PROC PHREG, then you need to look at the PHREG documentation and find out which output object contains parameter estimates. The PHREG doc is here: &lt;A href="https://go.documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_phreg_syntax18.htm&amp;amp;docsetVersion=15.1&amp;amp;locale=en" target="_blank"&gt;https://go.documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_phreg_syntax18.htm&amp;amp;docsetVersion=15.1&amp;amp;locale=en&lt;/A&gt; -- it looks like you're right that RESMART contains the Martingale residual -- if you want those  in a separate dataset, then you've got to have an ODS OUTPUT statement for RESMART.&lt;BR /&gt;&lt;BR /&gt;  I didn't see PROC PHREG in your posted code.&lt;BR /&gt;&lt;BR /&gt;Cynthia</description>
      <pubDate>Thu, 04 Jul 2019 19:33:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Output-out-options-to-visualize-model-results/m-p/571275#M18412</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2019-07-04T19:33:12Z</dc:date>
    </item>
    <item>
      <title>Re: Output out options to visualize model results</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Output-out-options-to-visualize-model-results/m-p/789723#M22491</link>
      <description>&lt;P&gt;I am got the same problems , the&amp;nbsp;EFFECTPLOT options only output the pramaters where model's covarance is&amp;nbsp;&lt;SPAN&gt;Discrete variables.However, if there are continuous variables in the model, the parameter estimation cannot be output,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I want to know how to deal this problem!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 14:10:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Output-out-options-to-visualize-model-results/m-p/789723#M22491</guid>
      <dc:creator>Phoenix_LJ</dc:creator>
      <dc:date>2022-01-12T14:10:07Z</dc:date>
    </item>
  </channel>
</rss>

