Invalid reference value error if REF= used with a SUBJECT= variable


See SAS Note 61382 for the most common cause of this error. The following describes a specific problem that was fixed in SAS® 9.2. For general information on setting reference levels, see SAS Note 37108.

For a variable specified in the SUBJECT= option of the REPEATED statement in PROC GENMOD, if you specify the REF= option in the CLASS statement for that variable then the following error is issued and no results from the REPEATED statement (the GEE results) are produced:

ERROR: Invalid reference value for variable

where variable is the variable name.

To avoid the error, create a duplicate of the variable and use it in place of the original variable in the SUBJECT= option.