BookmarkSubscribeRSS Feed
_maldini_
Barite | Level 11

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
Ksharp
Super User
That means there are missing value in cluster_var or  stratum_var .check your data.

StatDave
SAS Super FREQ

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. 

_maldini_
Barite | Level 11

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

 

StatDave
SAS Super FREQ

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. 

DrKristy
Calcite | Level 5

Is this a SURVEY procedure that is being created? It seems like a major oversight to not have a Proc Survey Genmod procedure. 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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.

Discussion stats
  • 5 replies
  • 4190 views
  • 2 likes
  • 4 in conversation