I'm trying to model a binary outcome (p1ODD
) on binary predictor variables (c1kdscc3
, c1kdscc4
and c1kdscc5
). When I try to do PROC GENMOD
, my log indicates that I have an invalid reference value for c1kdscc3
. It also tells me that there are no valid observations due to invalid responses in the response variable although earlier on in my code I have defined everything.
Here is the problematic code that appears before PROC GENMOD
section:
PROC FORMAT;
Value c1kdscc_binfmt
0 = "[3,4,5] Often or more (Ref)"
1 = "[1,2] Never/Seldom";
Value p1ODD_binfmt
0 = "Negative (Ref)"
1 = "Positive";
RUN;
TITLE "Logistic Regression Using PROC GENMOD";
PROC GENMOD DATA=MY;
CLASS c1kdscc3 (REF= "Often or more (Ref)") / PARAM = ref;
MODEL p1ODD = c1kdscc3 / DIST= binomial LINK=log SCALE=1;
RUN; QUIT;
Would anyone know if I should fix how I define my reference values for c1kdscc3 to c1kdscc5 and how best to re-write my response variable to work in PROC GENMOD?
Sample Data:
Age p1ODD c1kdscc3 clkdscc4 clkdscc5
12 Positive Very Often Always Always
16 Positive Seldom Quite Often Seldom
14 Negative Very Often Always Seldom
17 Negative Quite Often Seldom Very Often
13 Negative Quite Often Quite Often Seldom
17 Negative Quite Often Quite Often Never
Log and error messages:
172 /*Analysis using GENMOD*/
173
174
175 TITLE "Logistic Regression Using Proc GENMOD";
176 PROC GENMOD DATA=MY;
177 CLASS c1kdscc3 (REF= "Often or more (Ref)") / PARAM = ref;
178 MODEL p1ODD = c1kdscc3 / DIST= binomial LINK=log SCALE=1;
179 RUN;
ERROR: Invalid reference value for c1kdscc3.
ERROR: No valid observations due to invalid or missing values in the response, explanatory, offset, frequency, or weight variable.
NOTE: The SAS System stopped processing this step because of errors.
Thanks!