我正在尝试p1ODD
在二进制预测变量(c1kdscc3
和c1kdscc4
)上建模二进制结果( c1kdscc5
)。当我尝试这样做时PROC GENMOD
,我的日志显示我有一个无效的参考值c1kdscc3
。它还告诉我,由于响应变量中的响应无效,因此没有有效的观察结果,尽管在我的代码中早些时候我已经定义了所有内容。
以下是部分之前出现的有问题的代码PROC GENMOD
:
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;
有谁知道我是否应该修复如何定义 c1kdscc3 到 c1kdscc5 的参考值以及如何最好地重写我的响应变量以在 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
日志和错误消息:
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.
谢谢!