<?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: Logistic Regression for trend analysis using Complex survey data? in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Logistic-Regression-for-trend-analysis-using-Complex-survey-data/m-p/847440#M41958</link>
    <description>&lt;P&gt;The best way to come up with the coefficients for the orthogonal polynomials is to use the ORPOL function in IML.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/imlug/imlug_langref_sect314.htm#imlug.langref.orpoldesign" target="_blank"&gt;SAS Help Center: ORPOL Function&lt;/A&gt;&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;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 02 Dec 2022 12:50:44 GMT</pubDate>
    <dc:creator>SAS_Rob</dc:creator>
    <dc:date>2022-12-02T12:50:44Z</dc:date>
    <item>
      <title>Logistic Regression for trend analysis using Complex survey data?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Logistic-Regression-for-trend-analysis-using-Complex-survey-data/m-p/671839#M32122</link>
      <description>&lt;P&gt;I'm working with&lt;EM&gt; complex survey data&lt;/EM&gt; to get annual estimates for a particular dichotomous variable; I want to &lt;EM&gt;estimate if there's a trend in prevalence over time&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm planning to:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;merge each year's dataset together&lt;/LI&gt;&lt;LI&gt;create a categorical variable for all the years (my x variable)&lt;/LI&gt;&lt;LI&gt;run logistic regression using the dichotomous variable as y.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Right now, I don't plan on using any extra control variables like race or age--I'll add those in later if I need to.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm still fairly new to certain parts of working with complex survey data. Is there anything in particular I need to be sure to add into my code?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Currently, it looks like this:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;PROC SURVEYREG Data=trends Total=TOTALS NOMCAR; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;Weight weightvar;&lt;BR /&gt;&amp;nbsp;Strata stratavar;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Class year (reference='2013'); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; *2013 = beginning;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Model y (ref='0') = year / vadjust=none; &amp;nbsp; &amp;nbsp;&amp;nbsp; *Modeling probability for 'yes' outcome';&lt;BR /&gt;&amp;nbsp;&amp;nbsp; lsmeans year / diff;&lt;BR /&gt;&amp;nbsp;Format year year.;&lt;BR /&gt;&amp;nbsp;Run;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jul 2020 14:47:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Logistic-Regression-for-trend-analysis-using-Complex-survey-data/m-p/671839#M32122</guid>
      <dc:creator>SAS93</dc:creator>
      <dc:date>2020-07-23T14:47:57Z</dc:date>
    </item>
    <item>
      <title>Re: Logistic Regression for trend analysis using Complex survey data?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Logistic-Regression-for-trend-analysis-using-Complex-survey-data/m-p/672150#M32136</link>
      <description>&lt;P&gt;The code you have will let you know if any of the years differ.&amp;nbsp; To get at trends, you will need to implement either a CONTRAST statement or an LSMESTIMATE statement.&amp;nbsp; I don't know how many years are in the model, but assume that there are data for 2013, 2014, 2015, 2016, 2017, 2018 and 2019 (7 years).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using LSMESTIMATE:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;lsmestimate year 'Linear time' -3 -2 -1 0 1 2 3;

/* if you also wanted to look for both a linear and a quadratic trend it would be
lsmestimate year 'Linear time' -3-2-1 0 1 2 3,
                            'Quadratic time' 5 0 -3 -4 -3 0 5;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Alternatively, you could fit time as a continuous variable by deleting the CLASS year 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;</description>
      <pubDate>Fri, 24 Jul 2020 18:28:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Logistic-Regression-for-trend-analysis-using-Complex-survey-data/m-p/672150#M32136</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2020-07-24T18:28:44Z</dc:date>
    </item>
    <item>
      <title>Re: Logistic Regression for trend analysis using Complex survey data?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Logistic-Regression-for-trend-analysis-using-Complex-survey-data/m-p/847423#M41955</link>
      <description>Hi Steve,&lt;BR /&gt;&lt;BR /&gt;This thread was helpful. I completely understand your explaination on this comment. I am implementing a similar trend analysis but with 12 year cycles from 2008 to 2019.&lt;BR /&gt;Would the contrast be something like this ?&lt;BR /&gt;lsmestimate year 'Linear time'-5 -4 -3 -2 -1 0 1 2 3 4 5 6;&lt;BR /&gt;What would the quadratic time be? I will appreciate a response.&lt;BR /&gt;</description>
      <pubDate>Fri, 02 Dec 2022 09:27:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Logistic-Regression-for-trend-analysis-using-Complex-survey-data/m-p/847423#M41955</guid>
      <dc:creator>ChuksManuel</dc:creator>
      <dc:date>2022-12-02T09:27:10Z</dc:date>
    </item>
    <item>
      <title>Re: Logistic Regression for trend analysis using Complex survey data?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Logistic-Regression-for-trend-analysis-using-Complex-survey-data/m-p/847440#M41958</link>
      <description>&lt;P&gt;The best way to come up with the coefficients for the orthogonal polynomials is to use the ORPOL function in IML.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/imlug/imlug_langref_sect314.htm#imlug.langref.orpoldesign" target="_blank"&gt;SAS Help Center: ORPOL Function&lt;/A&gt;&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2022 12:50:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Logistic-Regression-for-trend-analysis-using-Complex-survey-data/m-p/847440#M41958</guid>
      <dc:creator>SAS_Rob</dc:creator>
      <dc:date>2022-12-02T12:50:44Z</dc:date>
    </item>
    <item>
      <title>Re: Logistic Regression for trend analysis using Complex survey data?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Logistic-Regression-for-trend-analysis-using-Complex-survey-data/m-p/847444#M41960</link>
      <description>&lt;P&gt;Some key things to note for trend tests using orthogonal polynomials.&amp;nbsp; The coefficients should sum to zero, so for a 12-nomial linear contrast the following would work: -11 -9 -7 -5 -3 -1 1 3 5 7 9 11. If you are interested in the value of the trend, this should use a divisor=2 option.&amp;nbsp; Quadratic form is relatively easy to calculate by hand - square each entry, get the average of those, subtract the average from each squared value, and reduce to lowest terms. So, 121 + 81 +49 + 25 + 9 + 1 +1 + 9 + 25 + 49 + 81 + 121 = 572, average = 572/12 = 47.66667 (=47 2/3), which gives 73 1/3&amp;nbsp; 33 1/3 1 1/3 -22 2/3 -38 2/3 -46 2/3&amp;nbsp; -46 2/3 -38 2/3 -22 2/3 1 1/3 33 1/3 73 1/3&amp;nbsp; --&amp;gt; 220 100 4 -68 -116 -140 -140 -116 -68 4 100 220 with divisor= 3 option. These could all be divided by 4 to get to lowest terms, but if you are interested in the actual value, I suggest stopping here.&amp;nbsp; You can check these against the results from the ORPOL function in IML that&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/155173"&gt;@SAS_Rob&lt;/a&gt;&amp;nbsp;mentioned.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2022 13:17:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Logistic-Regression-for-trend-analysis-using-Complex-survey-data/m-p/847444#M41960</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2022-12-02T13:17:30Z</dc:date>
    </item>
    <item>
      <title>Re: Logistic Regression for trend analysis using Complex survey data?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Logistic-Regression-for-trend-analysis-using-Complex-survey-data/m-p/847466#M41964</link>
      <description>I assume, and hope, that you are really using PROC SURVEYLOGISTIC and not PROC SURVEYREG which assumes that the response is normally distributed.</description>
      <pubDate>Fri, 02 Dec 2022 16:30:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Logistic-Regression-for-trend-analysis-using-Complex-survey-data/m-p/847466#M41964</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2022-12-02T16:30:52Z</dc:date>
    </item>
    <item>
      <title>Re: Logistic Regression for trend analysis using Complex survey data?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Logistic-Regression-for-trend-analysis-using-Complex-survey-data/m-p/847535#M41968</link>
      <description>Yes. I am using proc survey logistic for this.</description>
      <pubDate>Sat, 03 Dec 2022 03:09:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Logistic-Regression-for-trend-analysis-using-Complex-survey-data/m-p/847535#M41968</guid>
      <dc:creator>ChuksManuel</dc:creator>
      <dc:date>2022-12-03T03:09:55Z</dc:date>
    </item>
  </channel>
</rss>

