errors in SAS PROC GENMOD CLASS commands- need help

#1
I am trying to run PROC GENMOD using CLASS statements to define several variables. On some, but not all variables, I get the error message that "variable x has only one level". I know they all have 2-3 numeric levels. I am using SAS 9.1.3 with service pack 4, and I have run hotfixes for known issues from ftp://ftp.sas.com/techsup/download/hotfix/e9_win_sbcs.html#ba specific fix E9ST10 for Windows. Any idea why this is happening or how to fix this would be extremely appreciated. I have lost too many days of work already trying to solve this.
 

Mean Joe

TS Contributor
#2
All I can say is, maybe there is only one level--you could be losing data. One way that this can happen to your data:
You are modeling with some variables, that have missing values. Then those records get thrown out of the analysis, and thus you lose a level of values for your class variable.

eg
Code:
record class1 other1 other2 other3 outcome
001        A       11       12       13      0
002        B        21        .        23     0
003        C       31       32       .        1

proc genmod;
class class1;
model outcome = class1 other1 other2 other3;
run;
Variable class1 has 3 levels, but the procedure will ignore records 002 and 003 (losing levels B and C) so that only 1 level is visible to the model.
 
#3
All I can say is, maybe there is only one level--you could be losing data. One way that this can happen to your data:
You are modeling with some variables, that have missing values. Then those records get thrown out of the analysis, and thus you lose a level of values for your class variable.

eg
Code:
record class1 other1 other2 other3 outcome
001        A       11       12       13      0
002        B        21        .        23     0
003        C       31       32       .        1

proc genmod;
class class1;
model outcome = class1 other1 other2 other3;
run;
Variable class1 has 3 levels, but the procedure will ignore records 002 and 003 (losing levels B and C) so that only 1 level is visible to the model.
Thanks! You were correct about the missing data. The Primary dataset doesn't have missing values, but one of the datasets in the combined dataset has loads of missing values. Now I am trying to figure out the best way to analyze this since it has so many missing values.
I found a SAS document that describes "The GENMOD procedure can estimate the working correlation from data containing both types of missing values by using the all available pairs method, in which all non-missing pairs of data are used in the moment estimators of..." but I can't find how to do this.

from: http://support.sas.com/documentatio.../default/viewer.htm#statug_genmod_sect043.htm

Any suggestions about how to analyze this? I have tried with PROC MIXED and LOGISTIC, but I am also losing the data there. Uugghh! SAS makes me feel very stupid sometimes.
 

Link

Ninja say what!?!
#4
If you have missing data, there isn't really much you can do outside of proc MI. What can you really say if you have an exposure, but no outcome? You need both in order to make inferences.