Hello, I used the "class" keyword to declare it as a categorical variable, but the results of the SAS calculation were quite strange, especially the estimated p-value. Like this. Code: proc logistic data=database; class LT_RL_II(ref='0'); model Event_Variable(event='1')=LT_RL_II Gender Age PB_CII Dept_II Sleep/risklimits; run; But I got the tricky results. I found that the estimated value of the variable "LT_RL_II 3 v.s. 0" is not significant under the 95% confidence interval estimate (OR: 3.085 95%CI: 0.956-9.952), but in the above p-value estimate (p=0.0384). It shows significant (p<0.05). However, I used another approach, which divided categrocical data into dunny variable. The problem had been solved. Transfor Code if LT_RL_II= 0 then do ; g1=0; g2=0; g3=0; end; if LT_RL_II= 1 then do ; g1=1; g2=0; g3=0; end; if LT_RL_II= 2 then do ; g1=0; g2=1; g3=0; end; if LT_RL_II= 3 then do ; g1=0; g2=0; g3=1; end; run; After using dunny variable, the OR estimate is consistent with the method using the "Class" keyword, but the pvalue changes(pvalue:0.0594). In SAS regression syntax, when using the CLASS statement to declare categorical variables and automatically generate corresponding dummy variables, why the results in the maximum likelihood estimation table are inconsistent with manually generated ones (Figure 2, g1 (LT_TL_II level 1 vs. 0), g2 (LT_TL_II level 2 vs. 0), g3 (LT_TL_II level 3 vs. 0))? Interesting is that, apart from the maximum likelihood estimation table, the results of the two approaches are consistent in other aspects (OR estimation). Upon closer examination, the odds ratio (OR) estimates in Figure 1 should theoretically be non-significant, but they appear as significant variables in the maximum likelihood estimation. Conversely, the results in Figure 2 provide reasonable p-values (non-significant). This confuses me. Does SAS use two methods to estimate pvalue when executing this job? My Hardware cpu:i5-10350U RAM:4G SAS version: 9.4 at D5
... View more