Programming the statistical procedures from SAS

PROC GENMOD w/ Complex Survey Data

Reply
Regular Contributor
Posts: 199

PROC GENMOD w/ Complex Survey Data

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?

 

Super User
Posts: 9,769

Re: PROC GENMOD w/ Complex Survey Data

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

SAS Employee
Posts: 242

Re: PROC GENMOD w/ Complex Survey Data

[ Edited ]

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. 

Regular Contributor
Posts: 199

Re: PROC GENMOD w/ Complex Survey Data

[ Edited ]

@StatDave_sas 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!

 

SAS Employee
Posts: 242

Re: PROC GENMOD w/ Complex Survey Data

Currently, there is no SURVEY procedure for fitting count models using the Poisson or negative binomial distributions.  SURVEYREG will assume that the response is normally distributed. 

Ask a Question
Discussion stats
  • 4 replies
  • 286 views
  • 2 likes
  • 3 in conversation