<?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 Relative Measure with Continuous Outcomes in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Relative-Measure-with-Continuous-Outcomes/m-p/638131#M30522</link>
    <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using proc surveyreg to generate lsmeans of a continuous outcome across sex groups.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like both absolute difference and relative difference in means with corresponding 95%CIs, however the proc surveyreg procedure (which I MUST use as I have survey data) only generates absolute mean differences (meansex1 - meansex2), and will not give relative measures (meansex1/meansex2). I am wondering if this is a limitation of SAS and this procedure or if I am missing something?&amp;nbsp;&lt;/P&gt;&lt;P&gt;I posted a sample of my code below, where I have tried lsmeans, estimate and lsmestimate.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc surveyreg data=final varmethod=brr;&lt;BR /&gt;class sex;&lt;BR /&gt;model percent = sex/ clparm solution;&lt;BR /&gt;lsmeans sex/ cl diff e;&lt;BR /&gt;estimate "sex" sex -1 1 / cl;&lt;BR /&gt;lsmestimate sex -1 1/ cl;&lt;BR /&gt;weight wt;&lt;BR /&gt;repweights rep1-rep500;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 07 Apr 2020 16:33:27 GMT</pubDate>
    <dc:creator>warren22</dc:creator>
    <dc:date>2020-04-07T16:33:27Z</dc:date>
    <item>
      <title>Relative Measure with Continuous Outcomes</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Relative-Measure-with-Continuous-Outcomes/m-p/638131#M30522</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using proc surveyreg to generate lsmeans of a continuous outcome across sex groups.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like both absolute difference and relative difference in means with corresponding 95%CIs, however the proc surveyreg procedure (which I MUST use as I have survey data) only generates absolute mean differences (meansex1 - meansex2), and will not give relative measures (meansex1/meansex2). I am wondering if this is a limitation of SAS and this procedure or if I am missing something?&amp;nbsp;&lt;/P&gt;&lt;P&gt;I posted a sample of my code below, where I have tried lsmeans, estimate and lsmestimate.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc surveyreg data=final varmethod=brr;&lt;BR /&gt;class sex;&lt;BR /&gt;model percent = sex/ clparm solution;&lt;BR /&gt;lsmeans sex/ cl diff e;&lt;BR /&gt;estimate "sex" sex -1 1 / cl;&lt;BR /&gt;lsmestimate sex -1 1/ cl;&lt;BR /&gt;weight wt;&lt;BR /&gt;repweights rep1-rep500;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2020 16:33:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Relative-Measure-with-Continuous-Outcomes/m-p/638131#M30522</guid>
      <dc:creator>warren22</dc:creator>
      <dc:date>2020-04-07T16:33:27Z</dc:date>
    </item>
    <item>
      <title>Re: Relative Measure with Continuous Outcomes</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Relative-Measure-with-Continuous-Outcomes/m-p/638283#M30533</link>
      <description>&lt;P&gt;Getting relative differences is easy, standard errors of the relative differences not so much. To get the relative values, use ODS OUTPUT to get the lsmeans into a data set that you can process thru a DATA step to get the relative differences. Getting the standard errors would probably involve using the delta method to approximate the variance of a ratio and then converting the variance to a standard error.&amp;nbsp; There should be code somewhere on the interwebs that does this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;</description>
      <pubDate>Wed, 08 Apr 2020 11:29:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Relative-Measure-with-Continuous-Outcomes/m-p/638283#M30533</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2020-04-08T11:29:21Z</dc:date>
    </item>
    <item>
      <title>Re: Relative Measure with Continuous Outcomes</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Relative-Measure-with-Continuous-Outcomes/m-p/638324#M30542</link>
      <description>&lt;P&gt;The standard error and a large sample confidence interval for the ratio can be obtained either by the delta method or using Fieller's theorem. &lt;A href="http://support.sas.com/kb/56476" target="_self"&gt;This note&lt;/A&gt; discusses and illustrates how these methods can be applied in a bioassay situation. You can modify your SURVEYREG code and use the &lt;A href="http://support.sas.com/kb/58775" target="_self"&gt;NLEST macro&lt;/A&gt; to implement the delta method as shown in the following code. The NLEST macro can be directly called if you are using the current release, SAS 9.4 TS1M6. Otherwise, it can be downloaded from the link above.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc surveyreg data=final varmethod=brr;
class sex;
model percent = sex/ clparm solution;
store out=sreg;
lsmeans sex / cov;
ods output lsmeans=lsm;
run;
%NLEst(instore=sreg, label=Mean Ratio, f=b_p1/b_p2, df=1e8)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;A confidence interval for the ratio can also be obtained from Fieller's theorem and is computed by the code below&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;    %macro Fieller(out=RatioCI, num=, den=, label=Ratio, alpha=.05);
      proc iml;
        use lsm;
        read all var {Estimate} into beta;
        read all var {Cov1 Cov2} into cov;
        k={ &amp;amp;num }; h={ &amp;amp;den };
        ratio=(k*beta) / (h*beta);
        tsq=probit(1-&amp;amp;alpha/2)**2;
        a=(h*beta)**2-(tsq)*(h*cov*h`);
        b=2*(tsq*(k*cov*h`)-(k*beta)*(h*beta));
        c=(k*beta)**2 -(tsq)*(k*cov*k`);
        disc=((b**2)-4*a*c);
        if (disc&amp;lt;=0 | a&amp;lt;=0) then do;
          print "ERROR: confidence interval can't be computed";
          stop; 
        end;
        sroot=sqrt(disc);
        l_b=((-b)-sroot)/(2*a);
        u_b=((-b)+sroot)/(2*a);
        estlims=ratio||l_b||u_b;
        lname={"Estimate", "LCL", "UCL"};
        create &amp;amp;out from estlims[colname=lname];
        append from estlims;
        quit;
      data &amp;amp;out; 
        set &amp;amp;out;
        Ratio="&amp;amp;label";
        run;
      proc print data=&amp;amp;out;
        id Ratio;
        run;
    %mend;
%Fieller(num=1 0, den=0 1, label=Ratio)
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Apr 2020 14:42:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Relative-Measure-with-Continuous-Outcomes/m-p/638324#M30542</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2020-04-08T14:42:32Z</dc:date>
    </item>
    <item>
      <title>Re: Relative Measure with Continuous Outcomes</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Relative-Measure-with-Continuous-Outcomes/m-p/638332#M30544</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13633"&gt;@StatDave&lt;/a&gt; - That was the macro I remember seeing at some point.&amp;nbsp; Thanks for getting it up here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;</description>
      <pubDate>Wed, 08 Apr 2020 14:54:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Relative-Measure-with-Continuous-Outcomes/m-p/638332#M30544</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2020-04-08T14:54:07Z</dc:date>
    </item>
    <item>
      <title>Re: Relative Measure with Continuous Outcomes</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Relative-Measure-with-Continuous-Outcomes/m-p/638334#M30545</link>
      <description>&lt;P&gt;Thank you so much for providing this solution!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Apr 2020 14:56:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Relative-Measure-with-Continuous-Outcomes/m-p/638334#M30545</guid>
      <dc:creator>warren22</dc:creator>
      <dc:date>2020-04-08T14:56:53Z</dc:date>
    </item>
    <item>
      <title>Re: Relative Measure with Continuous Outcomes</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Relative-Measure-with-Continuous-Outcomes/m-p/638335#M30546</link>
      <description>&lt;P&gt;Thank you for providing insight to this issue! Very much appreciated:)&lt;/P&gt;</description>
      <pubDate>Wed, 08 Apr 2020 14:57:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Relative-Measure-with-Continuous-Outcomes/m-p/638335#M30546</guid>
      <dc:creator>warren22</dc:creator>
      <dc:date>2020-04-08T14:57:31Z</dc:date>
    </item>
    <item>
      <title>Re: Relative Measure with Continuous Outcomes</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Relative-Measure-with-Continuous-Outcomes/m-p/638433#M30550</link>
      <description>Could you mark StatDave's reply as a solution?&lt;BR /&gt;thanks,&lt;BR /&gt;SteveDenham</description>
      <pubDate>Wed, 08 Apr 2020 18:41:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Relative-Measure-with-Continuous-Outcomes/m-p/638433#M30550</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2020-04-08T18:41:12Z</dc:date>
    </item>
  </channel>
</rss>

