Turn on suggestions

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

Showing results for

- Home
- /
- Analytics
- /
- Stat Procs
- /
- PROC GENMOD w/ Complex Survey Data

Options

- 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-17-2016 07:09 PM
(4513 views)

I am using PROC GENMOD for the first time to analyze complex survey data. The outcome variable is a count, injuries per year, over 14 years, from 2002 to 2015.

I'm seeking some help in understanding the error message below.

I found some generic syntax online and ran it w/ my variables and data:

proc genmod data=data; class cluster_var stratum_var ; model y=x /dist=negbin link=log; weight psu_var; repeated subject =cluster_var(stratum_var); domain=flag; run;

I created a subset in a preceding DATA step by defining a variable, flag. I added the DOMAIN statement myself. It was not included in the sample code I found. I did not seem to produce an error, but I'm not sure if it worked properly either.

When I run this, the following messages are generated:

NOTE: Class levels for some variables were not printed due to excessive size.

NOTE: Algorithm converged.

ERROR: A missing value was detected in the SUBJECT, WITHINSUBJECT, or LOGORVAR effect. All values of variables in these effects must be non-missing.

Any ideas what this error message means?

5 REPLIES 5

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

That means there are missing value in cluster_var or stratum_var .check your data.

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

PROC GENMOD should not be used to analyze complex survey data. Only the SURVEY procedures (SURVEYFREQ, SURVEYLOGISTIC, etc.) can provide a proper analysis of survey sample data. A variable specified in the WEIGHT statement in other procedures may produce correct parameter estimates, but their variances will not be correct. Special variance estimators are needed in the analysis of survey data and only the SURVEY procedures have these estimators. There is currently no SURVEY procedure available for fitting count models such as Poisson or negative binomial models.

See this note for more.

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

@StatDave Wow. Thanks, I had no idea.

I have an outcome variable that is injuries per year. It's a count so I was going to use a negative binomial model...What SURVEY procedure should I used to determine if there is a linear relationship between year and injuries per year? Should I treat injuries per year as a continuous variable and use PROC SURVEYREG? Is there another approach?

Thanks!

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

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

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. **Registration is now open through August 30th**. Visit the SAS Hackathon homepage.

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.