<?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: Cost data with proc genmod in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Cost-data-with-proc-genmod/m-p/668236#M31906</link>
    <description>&lt;P&gt;Moved to STAT forum in the hope you'll get an answer there.&lt;/P&gt;</description>
    <pubDate>Fri, 10 Jul 2020 02:02:28 GMT</pubDate>
    <dc:creator>ChrisNZ</dc:creator>
    <dc:date>2020-07-10T02:02:28Z</dc:date>
    <item>
      <title>Cost data with proc genmod</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Cost-data-with-proc-genmod/m-p/667522#M31905</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to get the marginal difference in mean cost and 95% CI for an exposure with 5 groups using a GLM with log link and gamma distribution and have tried lsmeans, estimate, etc but all the results are off. I also tried %NLEstimate but it did not work for me.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any advice?&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc genmod data=t0 ;&lt;BR /&gt;class expa(ref="1") agegroup(ref='1') female(ref='1') region(ref='1') flag_ad(ref='0') flag_ohter_comb(ref='0')/param=ref;&lt;BR /&gt;model total_cost=expa agegroup female region flag_ad flag_ohter_comb/dist=gamma link=log type3;&lt;BR /&gt;store p1;&lt;BR /&gt;output out=c predicted=pred_c;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;expa is a categorical variable with 5 levels&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to get the exponential transformed cost and 95% CI for expa= 2 vs. 1, 3 vs. 1, 4 vs. 1, 5 vs. 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*Test incorrect results*/&lt;BR /&gt;proc genmod data=t0 ;&lt;BR /&gt;class expa(ref="1") agegroup(ref='1') female(ref='1') region(ref='1') flag_ad(ref='0') flag_ohter_comb(ref='0')/param=ref;&lt;BR /&gt;model total_cost=expa agegroup female region flag_ad flag_ohter_comb/dist=gamma link=log type3;&lt;BR /&gt;estimate 'expa=1' intercept 1 expa 1 agegroup 1 female 1 region 1 flag_ad 0 flag_ohter_comb 0 / exp;&lt;BR /&gt;estimate 'expa=2' intercept 1 expa 2 agegroup 1 female 1 region 1 flag_ad 0 flag_ohter_comb 0 / exp;&lt;BR /&gt;estimate 'expa=3' intercept 1 expa 3 agegroup 1 female 1 region 1 flag_ad 0 flag_ohter_comb 0 / exp;&lt;BR /&gt;estimate 'expa=4' intercept 1 expa 4 agegroup 1 female 1 region 1 flag_ad 0 flag_ohter_comb 0 / exp;&lt;BR /&gt;estimate 'expa=5' intercept 1 expa 5 agegroup 1 female 1 region 1 flag_ad 0 flag_ohter_comb 0 / exp;&lt;BR /&gt;lsmestimate expa "2 vs. 1" 2 1 / cl;&lt;BR /&gt;lsmestimate expa "3 vs 1" 3 1/ cl;&lt;BR /&gt;lsmestimate expa "4 vs 1" 4 1/ cl;&lt;BR /&gt;lsmestimate expa "5 vs 1" 5 1/ cl;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jul 2020 17:48:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Cost-data-with-proc-genmod/m-p/667522#M31905</guid>
      <dc:creator>SASHELP84</dc:creator>
      <dc:date>2020-07-07T17:48:16Z</dc:date>
    </item>
    <item>
      <title>Re: Cost data with proc genmod</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Cost-data-with-proc-genmod/m-p/668236#M31906</link>
      <description>&lt;P&gt;Moved to STAT forum in the hope you'll get an answer there.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 02:02:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Cost-data-with-proc-genmod/m-p/668236#M31906</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-07-10T02:02:28Z</dc:date>
    </item>
    <item>
      <title>Re: Cost data with proc genmod</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Cost-data-with-proc-genmod/m-p/668350#M31914</link>
      <description>&lt;P&gt;I am almost certain that the coefficients you are supplying are not what you want.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Why not do something like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;lsmeans expa/diff=control cl exp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This will construct the differences between each noncontrol level and the control level (which defaults to the first level) and the confidence bounds, followed by exponentiating each of those.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For the lsmestimate statements, you need to construct differences rather than the sums of treatment 2 and multiples of treatment 1.&amp;nbsp; Try&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;lsmestimate expa "2 vs 1" -1 1  0 0 0/ cl exp;
lsmestimate expa "3 vs 1" -1 0 1 0 0/ cl exp;
lsmestimate expa "4 vs 1" -1 0 0 1 0/ cl exp;
lsmestimate expa "5 vs 1" -1 0 0 0 1/ cl exp;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This should give results that are identical to the lsmeans diffs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 12:33:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Cost-data-with-proc-genmod/m-p/668350#M31914</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2020-07-10T12:33:14Z</dc:date>
    </item>
    <item>
      <title>Re: Cost data with proc genmod</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Cost-data-with-proc-genmod/m-p/668360#M31917</link>
      <description>&lt;P&gt;The NLEstimate macro could certainly work, but since you just want differences of means it would be easier to use the NLMeans macro.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc genmod data=t0 ;
  class expa(ref="1") agegroup(ref='1') female(ref='1') region(ref='1') flag_ad(ref='0') flag_ohter_comb(ref='0')/param=ref;
  model total_cost=expa agegroup female region flag_ad flag_ohter_comb/dist=gamma link=log type3;
  store p1;
  run;
proc plm restore=pl;
  lsmeans expa / e ilink diff exp;
  ods output coef=coeffs;
  run;
%NLMeans(instore=pl, coef=coeffs, link=log, title=Difference of EXPA means)&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 Jul 2020 13:16:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Cost-data-with-proc-genmod/m-p/668360#M31917</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2020-07-10T13:16:39Z</dc:date>
    </item>
  </channel>
</rss>

