<?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 ESTIMATE statement in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/ESTIMATE-statement/m-p/849588#M335864</link>
    <description>&lt;P&gt;Hi friends,&lt;/P&gt;&lt;P&gt;I am trying to get the adjusted prevalence ratios for the use of e-cig use (vs non-users) by the exposure to poor mental health in the past 30 days. The outcome is QN35 (current e-cig use coded 1 for those used it in the past 30 days vs. 2 for non-users). The exposure variable is QN85 (mental health is poor in the past 30 days: 1 - yes, 2-no). I am trying to estimate the adjusted prevalence ratio (aPR) for the use of e-cig by poor mental health while adjusting for socio-demographic variables (listed in the CLASS statement). I am modeling the use of e-cig (QN35=1) but the aPR that I get does not make sense. I mean I am expecting the aPR to be above 1 (poor mental health is associated with higher risk to use e-cig) but I am getting an aPR below 1, which is not what expected and is contradicting the direction of the OR obtained from the logistic regression modeling. All estimates I got are in the opposite direction to what is expected. When I switch to (-1) in the ESTIMATE statement (instead of 1), then I get the expected aPR (above 1). I guess I am having trouble figuring out the coding in the ESTIMATE statement and how to correctly do that. The design variable output for the exposure variable (QN85) in SAS shows that 1 (Yes) is coded as 1 while 2 (No) is coded as 0. So, when I put 1 in the ESTIMATE statement, I guess 0 is the reference (aPR for Yes vs No) but if I switch to -1, then I am estimating the aPR for No vs Yes? I am completely confused and I have no idea how to fix the code to get appropriate aPR that make sense. Any help is appreciated. The code I am using is below. TIA.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC GENMOD DATA=NEW ;&lt;BR /&gt;CLASS PSU STRATUM QN85 (REF='2') Q2 (REF='Male') NEWRACE (REF='WHITE') NEWGRADE (REF='9TH GRADE') SEXORIENTATION (REF='HETEROSEXUAL') INSTRMDL (REF='Other')/PARAM=REF;&lt;BR /&gt;WEIGHT WEIGHT;&lt;BR /&gt;MODEL QN35(event='1') = QN85 Q2 NEWRACE NEWGRADE SEXORIENTATION INSTRMDL/ Dist=poisson Link=log type3;&lt;BR /&gt;ESTIMATE 'RR CURRENT MENTAL HEALTH NOT GOOD YES vs. NO' QN85 1/EXP;&lt;BR /&gt;REPEATED SUBJECT = PSU(STRATUM);&lt;BR /&gt;RUN;&lt;/P&gt;</description>
    <pubDate>Wed, 14 Dec 2022 09:30:04 GMT</pubDate>
    <dc:creator>SAS_BW</dc:creator>
    <dc:date>2022-12-14T09:30:04Z</dc:date>
    <item>
      <title>ESTIMATE statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ESTIMATE-statement/m-p/849588#M335864</link>
      <description>&lt;P&gt;Hi friends,&lt;/P&gt;&lt;P&gt;I am trying to get the adjusted prevalence ratios for the use of e-cig use (vs non-users) by the exposure to poor mental health in the past 30 days. The outcome is QN35 (current e-cig use coded 1 for those used it in the past 30 days vs. 2 for non-users). The exposure variable is QN85 (mental health is poor in the past 30 days: 1 - yes, 2-no). I am trying to estimate the adjusted prevalence ratio (aPR) for the use of e-cig by poor mental health while adjusting for socio-demographic variables (listed in the CLASS statement). I am modeling the use of e-cig (QN35=1) but the aPR that I get does not make sense. I mean I am expecting the aPR to be above 1 (poor mental health is associated with higher risk to use e-cig) but I am getting an aPR below 1, which is not what expected and is contradicting the direction of the OR obtained from the logistic regression modeling. All estimates I got are in the opposite direction to what is expected. When I switch to (-1) in the ESTIMATE statement (instead of 1), then I get the expected aPR (above 1). I guess I am having trouble figuring out the coding in the ESTIMATE statement and how to correctly do that. The design variable output for the exposure variable (QN85) in SAS shows that 1 (Yes) is coded as 1 while 2 (No) is coded as 0. So, when I put 1 in the ESTIMATE statement, I guess 0 is the reference (aPR for Yes vs No) but if I switch to -1, then I am estimating the aPR for No vs Yes? I am completely confused and I have no idea how to fix the code to get appropriate aPR that make sense. Any help is appreciated. The code I am using is below. TIA.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC GENMOD DATA=NEW ;&lt;BR /&gt;CLASS PSU STRATUM QN85 (REF='2') Q2 (REF='Male') NEWRACE (REF='WHITE') NEWGRADE (REF='9TH GRADE') SEXORIENTATION (REF='HETEROSEXUAL') INSTRMDL (REF='Other')/PARAM=REF;&lt;BR /&gt;WEIGHT WEIGHT;&lt;BR /&gt;MODEL QN35(event='1') = QN85 Q2 NEWRACE NEWGRADE SEXORIENTATION INSTRMDL/ Dist=poisson Link=log type3;&lt;BR /&gt;ESTIMATE 'RR CURRENT MENTAL HEALTH NOT GOOD YES vs. NO' QN85 1/EXP;&lt;BR /&gt;REPEATED SUBJECT = PSU(STRATUM);&lt;BR /&gt;RUN;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2022 09:30:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ESTIMATE-statement/m-p/849588#M335864</guid>
      <dc:creator>SAS_BW</dc:creator>
      <dc:date>2022-12-14T09:30:04Z</dc:date>
    </item>
    <item>
      <title>Re: ESTIMATE statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ESTIMATE-statement/m-p/849589#M335865</link>
      <description>&lt;P&gt;I am attaching the SAS output below.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2022 09:37:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ESTIMATE-statement/m-p/849589#M335865</guid>
      <dc:creator>SAS_BW</dc:creator>
      <dc:date>2022-12-14T09:37:38Z</dc:date>
    </item>
  </channel>
</rss>

