BookmarkSubscribeRSS Feed
lionking19063
Fluorite | Level 6

Hi,

I performed regression analysis using proc hpreg and found out some dummy variables are missing in all of df, estimate, standard error, p value. However when I applied proc hpreg on these dummy variables only, these dummy variables have values/outputs. Does anyone have any insight about it? Thanks.

1 REPLY 1
PaigeMiller
Diamond | Level 26

It depends on how you computed the dummy variables.

 

If the sum of all the dummy variables for a variable add to 1 for every record, then you get the results you saw, and SAS has done the right thing. Very simple example using gender:

 

 

dummy_F         dummy_M                sum
1                  0                     1
0                  1                     1

 

Gender has two levels and therefore it has 1 degree of freedom, only one effect from one dummy variable can be estimated. The other effect is uniquely determined, and so has 0 degrees of freedom.

 

On the other hand, if you use just dummy_F and not dummy_M, you get the same results in terms of predicted values, but you don't run into the problem where some of the dummy variables have zero degrees of freedom.

 

Which brings us to the solution: do not use dummy variables that you have created for PROC LOGISTIC, PROC HPREG, PROC GLM, PROC GLIMMIX and many others. The CLASS statement not only creates dummy variables behind the scene, but it guarantees it is done properly and analyzed properly. And the CLASS statement is much easier than creating your own dummy variables.

 

--
Paige Miller

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 243 views
  • 2 likes
  • 2 in conversation