<?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: How to do a trend test for complex survey data (ie. NIS from HCUP)? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-do-a-trend-test-for-complex-survey-data-ie-NIS-from-HCUP/m-p/603183#M76461</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/202123"&gt;@knicks1189&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know how to test for trends when your data needs to account for a complex survey design?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, I am using NIS data by HCUP and they require that proc SURVEYFREQ be used to analyze any frequencies. However, there is no option to test for a cochran-armitage test in that procedure like there is in proc FREQ. I see a lot of papers online that I think just use proc freq with complex data, however, I think that is incorrect because that does not take into account the survey design of the samples. Any help would be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;(You can't do this with SURVEYFREQ afaik. You can use SURVEYFREQ to generate your estimates. For trend tests you might be able to use SURVEYREG; it depends on the type of estimates for which you are testing trend. If means and proportions then read on. If something more complex, then I think you are out of luck.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What you need is the ability to specifiy a contrast of the estimates using the coefficients of orthogonoal polynomials corresponding to the level of the contrast (linear, quadratic, cubic, etc.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, SURVEYFREQ and SURVEYMEANS do not have a contrast statement though SURVEYREG does.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you can generate your estimates as the beta coefficients to a linear regression model, you can test for trend (linear, quadratc, cubic, etc.) with SURVEYREG.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Suppose, for example, you are calculating the means of several groups and want to determine if there is a linear trend across the group means;&amp;nbsp; this assumes an ordering of the groups in order to conceptualize the notion of trend.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyway, you can create the group means with SURVEYMEANS and SURVEYREG.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Key SURVEYREG code would look like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;class groups;&lt;/P&gt;&lt;P&gt;model y=groups / noint;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Assuming group has 4 levels with values 1-4 and you want to test for linear trend from 1 to 4 of the group means, you'd use the following contrast statement:&lt;/P&gt;&lt;P&gt;contrast groups -3 -1 1 3;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This SAS note shows you how to generate orthogonal contrast coefficents that depend on the number of levels of your variable and the type of contrast you want to test:&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/kb/22/912.html" target="_blank" rel="noopener"&gt;http://support.sas.com/kb/22/912.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think if you are wanting to test trend for estimates of percents or means that this approach will work for you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Good Luck!&lt;/P&gt;</description>
    <pubDate>Mon, 11 Nov 2019 13:25:21 GMT</pubDate>
    <dc:creator>DWilson</dc:creator>
    <dc:date>2019-11-11T13:25:21Z</dc:date>
    <item>
      <title>How to do a trend test for complex survey data (ie. NIS from HCUP)?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-do-a-trend-test-for-complex-survey-data-ie-NIS-from-HCUP/m-p/603009#M76459</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know how to test for trends when your data needs to account for a complex survey design?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, I am using NIS data by HCUP and they require that proc SURVEYFREQ be used to analyze any frequencies. However, there is no option to test for a cochran-armitage test in that procedure like there is in proc FREQ. I see a lot of papers online that I think just use proc freq with complex data, however, I think that is incorrect because that does not take into account the survey design of the samples. Any help would be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sat, 09 Nov 2019 20:13:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-do-a-trend-test-for-complex-survey-data-ie-NIS-from-HCUP/m-p/603009#M76459</guid>
      <dc:creator>knicks1189</dc:creator>
      <dc:date>2019-11-09T20:13:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to do a trend test for complex survey data (ie. NIS from HCUP)?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-do-a-trend-test-for-complex-survey-data-ie-NIS-from-HCUP/m-p/603183#M76461</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/202123"&gt;@knicks1189&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know how to test for trends when your data needs to account for a complex survey design?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, I am using NIS data by HCUP and they require that proc SURVEYFREQ be used to analyze any frequencies. However, there is no option to test for a cochran-armitage test in that procedure like there is in proc FREQ. I see a lot of papers online that I think just use proc freq with complex data, however, I think that is incorrect because that does not take into account the survey design of the samples. Any help would be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;(You can't do this with SURVEYFREQ afaik. You can use SURVEYFREQ to generate your estimates. For trend tests you might be able to use SURVEYREG; it depends on the type of estimates for which you are testing trend. If means and proportions then read on. If something more complex, then I think you are out of luck.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What you need is the ability to specifiy a contrast of the estimates using the coefficients of orthogonoal polynomials corresponding to the level of the contrast (linear, quadratic, cubic, etc.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, SURVEYFREQ and SURVEYMEANS do not have a contrast statement though SURVEYREG does.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you can generate your estimates as the beta coefficients to a linear regression model, you can test for trend (linear, quadratc, cubic, etc.) with SURVEYREG.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Suppose, for example, you are calculating the means of several groups and want to determine if there is a linear trend across the group means;&amp;nbsp; this assumes an ordering of the groups in order to conceptualize the notion of trend.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyway, you can create the group means with SURVEYMEANS and SURVEYREG.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Key SURVEYREG code would look like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;class groups;&lt;/P&gt;&lt;P&gt;model y=groups / noint;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Assuming group has 4 levels with values 1-4 and you want to test for linear trend from 1 to 4 of the group means, you'd use the following contrast statement:&lt;/P&gt;&lt;P&gt;contrast groups -3 -1 1 3;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This SAS note shows you how to generate orthogonal contrast coefficents that depend on the number of levels of your variable and the type of contrast you want to test:&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/kb/22/912.html" target="_blank" rel="noopener"&gt;http://support.sas.com/kb/22/912.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think if you are wanting to test trend for estimates of percents or means that this approach will work for you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Good Luck!&lt;/P&gt;</description>
      <pubDate>Mon, 11 Nov 2019 13:25:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-do-a-trend-test-for-complex-survey-data-ie-NIS-from-HCUP/m-p/603183#M76461</guid>
      <dc:creator>DWilson</dc:creator>
      <dc:date>2019-11-11T13:25:21Z</dc:date>
    </item>
  </channel>
</rss>

