Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Home
- /
- Programming
- /
- SAS Procedures
- /
- How to do a trend test for complex survey data (ie. NIS from HCUP)?

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 11-09-2019 03:13 PM
(2113 views)

Hi,

Does anyone know how to test for trends when your data needs to account for a complex survey design?

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.

Thanks

1 REPLY 1

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

@knicks1189 wrote:Hi,

Does anyone know how to test for trends when your data needs to account for a complex survey design?

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.

Thanks

(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.)

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.)

Unfortunately, SURVEYFREQ and SURVEYMEANS do not have a contrast statement though SURVEYREG does.

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.

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; this assumes an ordering of the groups in order to conceptualize the notion of trend.

Anyway, you can create the group means with SURVEYMEANS and SURVEYREG.

Key SURVEYREG code would look like this:

class groups;

model y=groups / noint;

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:

contrast groups -3 -1 1 3;

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:

http://support.sas.com/kb/22/912.html

I think if you are wanting to test trend for estimates of percents or means that this approach will work for you.

Good Luck!

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

**If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. **

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.