<?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: Using estimate statement in proc surveyreg in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Using-estimate-statement-in-proc-surveyreg/m-p/692695#M33427</link>
    <description>&lt;P&gt;Hi, I am trying to find the estimates related to the effects of &amp;nbsp;gender on the relationship between two variables.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used an estimate statement in the code as follows....&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class=" block-mark"&gt;&lt;SPAN class="sec-keyword"&gt;proc&lt;/SPAN&gt; &lt;SPAN class="sec-keyword"&gt;surveyreg&lt;/SPAN&gt; &lt;SPAN class="keyword"&gt;data&lt;/SPAN&gt;&lt;SPAN class="sep"&gt;=&lt;/SPAN&gt;&lt;SPAN class="text"&gt;nhanes4 &lt;/SPAN&gt;&lt;SPAN class="keyword"&gt;order&lt;/SPAN&gt;&lt;SPAN class="sep"&gt;=&lt;/SPAN&gt;&lt;SPAN class="text"&gt;formatted&lt;/SPAN&gt;&lt;SPAN class="sep"&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="keyword"&gt;cluster&lt;/SPAN&gt;&lt;SPAN class="text"&gt; SDMVPSU&lt;/SPAN&gt;&lt;SPAN class="sep"&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="keyword"&gt;strata&lt;/SPAN&gt;&lt;SPAN class="text"&gt; SDMVSTRA&lt;/SPAN&gt;&lt;SPAN class="sep"&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="keyword"&gt;weight&lt;/SPAN&gt;&lt;SPAN class="text"&gt; WTSH2YR&lt;/SPAN&gt;&lt;SPAN class="sep"&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="keyword"&gt;class&lt;/SPAN&gt;&lt;SPAN class="text"&gt; vaper riagendr age race income cigs bmi&lt;/SPAN&gt;&lt;SPAN class="sep"&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="keyword"&gt;model&lt;/SPAN&gt;&lt;SPAN class="text"&gt; loglead&lt;/SPAN&gt;&lt;SPAN class="sep"&gt;=&lt;/SPAN&gt;&lt;SPAN class="text"&gt; vaper&lt;/SPAN&gt;&lt;SPAN class="sep"&gt;|&lt;/SPAN&gt;&lt;SPAN class="text"&gt;riagendr ridageyr bmxbmI race income cigs&lt;/SPAN&gt;&lt;SPAN class="sep"&gt;/&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="keyword"&gt;solution&lt;/SPAN&gt; &lt;SPAN class="keyword"&gt;clparm&lt;/SPAN&gt;&lt;SPAN class="sep"&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="keyword"&gt;format&lt;/SPAN&gt;&lt;SPAN class="text"&gt; vaper &lt;/SPAN&gt;&lt;SPAN class="format"&gt;vaperf.&lt;/SPAN&gt;&lt;SPAN class="text"&gt; riagendr &lt;/SPAN&gt;&lt;SPAN class="format"&gt;genderf.&lt;/SPAN&gt;&lt;SPAN class="text"&gt; race &lt;/SPAN&gt;&lt;SPAN class="format"&gt;racef.&lt;/SPAN&gt;&lt;SPAN class="text"&gt; income&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="format"&gt;incomef.&lt;/SPAN&gt;&lt;SPAN class="text"&gt; cigs &lt;/SPAN&gt;&lt;SPAN class="format"&gt;cigsf.&lt;/SPAN&gt; &lt;SPAN class="sep"&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="keyword"&gt;estimate&lt;/SPAN&gt; &lt;SPAN class="string"&gt;'comparing males and females'&lt;/SPAN&gt;&lt;SPAN class="text"&gt; riagendr &lt;/SPAN&gt;&lt;SPAN class="sep"&gt;-&lt;/SPAN&gt;&lt;SPAN class="numeric"&gt;1&lt;/SPAN&gt; &lt;SPAN class="numeric"&gt;1&lt;/SPAN&gt;&lt;SPAN class="sep"&gt;/&lt;/SPAN&gt;&lt;SPAN class="keyword"&gt;exp&lt;/SPAN&gt;&lt;SPAN class="sep"&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="keyword"&gt;title&lt;/SPAN&gt; &lt;SPAN class="string"&gt;"Model with Gender Interaction Term"&lt;/SPAN&gt;&lt;SPAN class="sep"&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="sec-keyword"&gt;run&lt;/SPAN&gt;&lt;SPAN class="sep"&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="sep"&gt;somehow, I am not able to get the estimates for males and the estimates for females. Rather, it gives me a single estimate with male as the reference. Is there another way I can code this to give me two separate estimates, one each for male and females?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="sep"&gt;thanks&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Mon, 19 Oct 2020 20:25:19 GMT</pubDate>
    <dc:creator>kukie</dc:creator>
    <dc:date>2020-10-19T20:25:19Z</dc:date>
    <item>
      <title>Using estimate statement in proc surveyreg</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Using-estimate-statement-in-proc-surveyreg/m-p/692692#M33426</link>
      <description />
      <pubDate>Mon, 19 Oct 2020 20:19:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Using-estimate-statement-in-proc-surveyreg/m-p/692692#M33426</guid>
      <dc:creator>kukie</dc:creator>
      <dc:date>2020-10-19T20:19:20Z</dc:date>
    </item>
    <item>
      <title>Re: Using estimate statement in proc surveyreg</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Using-estimate-statement-in-proc-surveyreg/m-p/692695#M33427</link>
      <description>&lt;P&gt;Hi, I am trying to find the estimates related to the effects of &amp;nbsp;gender on the relationship between two variables.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used an estimate statement in the code as follows....&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class=" block-mark"&gt;&lt;SPAN class="sec-keyword"&gt;proc&lt;/SPAN&gt; &lt;SPAN class="sec-keyword"&gt;surveyreg&lt;/SPAN&gt; &lt;SPAN class="keyword"&gt;data&lt;/SPAN&gt;&lt;SPAN class="sep"&gt;=&lt;/SPAN&gt;&lt;SPAN class="text"&gt;nhanes4 &lt;/SPAN&gt;&lt;SPAN class="keyword"&gt;order&lt;/SPAN&gt;&lt;SPAN class="sep"&gt;=&lt;/SPAN&gt;&lt;SPAN class="text"&gt;formatted&lt;/SPAN&gt;&lt;SPAN class="sep"&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="keyword"&gt;cluster&lt;/SPAN&gt;&lt;SPAN class="text"&gt; SDMVPSU&lt;/SPAN&gt;&lt;SPAN class="sep"&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="keyword"&gt;strata&lt;/SPAN&gt;&lt;SPAN class="text"&gt; SDMVSTRA&lt;/SPAN&gt;&lt;SPAN class="sep"&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="keyword"&gt;weight&lt;/SPAN&gt;&lt;SPAN class="text"&gt; WTSH2YR&lt;/SPAN&gt;&lt;SPAN class="sep"&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="keyword"&gt;class&lt;/SPAN&gt;&lt;SPAN class="text"&gt; vaper riagendr age race income cigs bmi&lt;/SPAN&gt;&lt;SPAN class="sep"&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="keyword"&gt;model&lt;/SPAN&gt;&lt;SPAN class="text"&gt; loglead&lt;/SPAN&gt;&lt;SPAN class="sep"&gt;=&lt;/SPAN&gt;&lt;SPAN class="text"&gt; vaper&lt;/SPAN&gt;&lt;SPAN class="sep"&gt;|&lt;/SPAN&gt;&lt;SPAN class="text"&gt;riagendr ridageyr bmxbmI race income cigs&lt;/SPAN&gt;&lt;SPAN class="sep"&gt;/&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="keyword"&gt;solution&lt;/SPAN&gt; &lt;SPAN class="keyword"&gt;clparm&lt;/SPAN&gt;&lt;SPAN class="sep"&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="keyword"&gt;format&lt;/SPAN&gt;&lt;SPAN class="text"&gt; vaper &lt;/SPAN&gt;&lt;SPAN class="format"&gt;vaperf.&lt;/SPAN&gt;&lt;SPAN class="text"&gt; riagendr &lt;/SPAN&gt;&lt;SPAN class="format"&gt;genderf.&lt;/SPAN&gt;&lt;SPAN class="text"&gt; race &lt;/SPAN&gt;&lt;SPAN class="format"&gt;racef.&lt;/SPAN&gt;&lt;SPAN class="text"&gt; income&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="format"&gt;incomef.&lt;/SPAN&gt;&lt;SPAN class="text"&gt; cigs &lt;/SPAN&gt;&lt;SPAN class="format"&gt;cigsf.&lt;/SPAN&gt; &lt;SPAN class="sep"&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="keyword"&gt;estimate&lt;/SPAN&gt; &lt;SPAN class="string"&gt;'comparing males and females'&lt;/SPAN&gt;&lt;SPAN class="text"&gt; riagendr &lt;/SPAN&gt;&lt;SPAN class="sep"&gt;-&lt;/SPAN&gt;&lt;SPAN class="numeric"&gt;1&lt;/SPAN&gt; &lt;SPAN class="numeric"&gt;1&lt;/SPAN&gt;&lt;SPAN class="sep"&gt;/&lt;/SPAN&gt;&lt;SPAN class="keyword"&gt;exp&lt;/SPAN&gt;&lt;SPAN class="sep"&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="keyword"&gt;title&lt;/SPAN&gt; &lt;SPAN class="string"&gt;"Model with Gender Interaction Term"&lt;/SPAN&gt;&lt;SPAN class="sep"&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="sec-keyword"&gt;run&lt;/SPAN&gt;&lt;SPAN class="sep"&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="sep"&gt;somehow, I am not able to get the estimates for males and the estimates for females. Rather, it gives me a single estimate with male as the reference. Is there another way I can code this to give me two separate estimates, one each for male and females?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="sep"&gt;thanks&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 19 Oct 2020 20:25:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Using-estimate-statement-in-proc-surveyreg/m-p/692695#M33427</guid>
      <dc:creator>kukie</dc:creator>
      <dc:date>2020-10-19T20:25:19Z</dc:date>
    </item>
    <item>
      <title>Re: Using estimate statement in proc surveyreg</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Using-estimate-statement-in-proc-surveyreg/m-p/692844#M33428</link>
      <description>&lt;P&gt;Since gender is involved in an interaction you really can't look at a single parameter estimate to get the estimates for each of the two groups.&amp;nbsp; In this case it is probably easiest to use the LSMEANS statement.&lt;/P&gt;
&lt;P&gt;lsmeans riagendr;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Oct 2020 12:49:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Using-estimate-statement-in-proc-surveyreg/m-p/692844#M33428</guid>
      <dc:creator>SAS_Rob</dc:creator>
      <dc:date>2020-10-20T12:49:21Z</dc:date>
    </item>
    <item>
      <title>Re: Using estimate statement in proc surveyreg</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Using-estimate-statement-in-proc-surveyreg/m-p/692849#M33429</link>
      <description>&lt;P&gt;I think what you are calling estimates are estimates of the parameters, which under the non-full rank parameterization used, sets the last category to zero.&amp;nbsp; Using the LSMEANS statement combines the necessary elements to calculate the expected population mean for each level of a categorical variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is a case where using the LSMEANS and LSMESTIMATE statement is an advantage;&amp;nbsp; Try adding this to your code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;lsmeans vaper|riagender/e;
lsmestimate riagender "Males vs Females, averaged over vaper status' -1 1/exp;
lsmestimate vaper*riagender 'Males vs Females, vaper status=no'  -1 1 0 0,
                                                'Males vs Females, vaper status=yes' 0 0 -1 1/exp;
&lt;/PRE&gt;
&lt;P&gt;You may need to rearrange the coefficients in the second LSMESTIMATE statement to reflect the parameterization given in the LSMEANS statement by the /e option.&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Oct 2020 13:03:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Using-estimate-statement-in-proc-surveyreg/m-p/692849#M33429</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2020-10-20T13:03:03Z</dc:date>
    </item>
    <item>
      <title>Re: Using estimate statement in proc surveyreg</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Using-estimate-statement-in-proc-surveyreg/m-p/693851#M33493</link>
      <description>&lt;P&gt;Hi Steve,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for this. The challenge I have now is that I have three levels of vapers - never vapers, former vapers and current vapers and I am struggling with the parameterization. I am unsure how to account for the three levels.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Fri, 23 Oct 2020 17:10:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Using-estimate-statement-in-proc-surveyreg/m-p/693851#M33493</guid>
      <dc:creator>kukie</dc:creator>
      <dc:date>2020-10-23T17:10:12Z</dc:date>
    </item>
    <item>
      <title>Re: Using estimate statement in proc surveyreg</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Using-estimate-statement-in-proc-surveyreg/m-p/693854#M33494</link>
      <description>&lt;P&gt;That should not present a problem - once again it is why LSMESTIMATE statements are so useful.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;lsmeans vaper|riagender/e;
lsmestimate riagender "Males vs Females, averaged over vaper status' -1 1/exp;
lsmestimate vaper*riagender 'Males vs Females, vaper status=never'  -1 1  0 0  0 0,
                            'Males vs Females, vaper status=former' 0 0  -1 1  0 0,
                            'Males vs Females, vaper status=current' 0 0  0 0  -1 1/exp;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This now gets trickier.&amp;nbsp; I just stuck these in, and the correct version depends on the ordering of vaper levels.&amp;nbsp; Since there is nothing in the CLASS statement and I assume that the levels are in fact&amp;nbsp; 'Current', 'Former', and 'Never', the lsmeans will sort in alphabetical order.&amp;nbsp; That means the code should look like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;lsmeans vaper|riagender/e;
lsmestimate riagender "Males vs Females, averaged over vaper status' -1 1/exp;
lsmestimate vaper*riagender 'Males vs Females, vaper status=current'  -1 1  0 0  0 0,
                            'Males vs Females, vaper status=former' 0 0  -1 1  0 0,
                            'Males vs Females, vaper status=never' 0 0  0 0  -1 1/exp;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If there is another coding for the vaper levels, it can be handled once you know the order that things appear in the LSMEANS statement.&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Oct 2020 17:23:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Using-estimate-statement-in-proc-surveyreg/m-p/693854#M33494</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2020-10-23T17:23:50Z</dc:date>
    </item>
    <item>
      <title>Re: Using estimate statement in proc surveyreg</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Using-estimate-statement-in-proc-surveyreg/m-p/694386#M33519</link>
      <description>&lt;P&gt;Thank you Steve,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Oct 2020 22:50:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Using-estimate-statement-in-proc-surveyreg/m-p/694386#M33519</guid>
      <dc:creator>kukie</dc:creator>
      <dc:date>2020-10-26T22:50:36Z</dc:date>
    </item>
  </channel>
</rss>

