BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
darkwob
Calcite | Level 5

Hi All,

 

I am running a multiple logistic regression analysis with mortality (event = 1) as the dependent variable and various ranges of age (65-69, 70-74, 75-79, 80+) as the independent variables (see code below). When running the analysis, the variable "Age 80+" is displaying zero degrees of freedom and there is no subsequent result generated (see image below)

 

The code is as follows:

"proc logistic data=WORK.OBESITY;
class Age_65_69 Age_70_74 Age_75_79 Age_80_ / param=glm descending;
model Overall_Mortality(event='1')=Age_65_69 Age_70_74 Age_75_79 Age_80_ /
link=logit technique=fisher;
run;"

 

darkwob_0-1597066398137.png

 

Reviewing the data, each independent variable has either 0 or 1 as possible inputs, and none of the columns share the same sum.

 

I would greatly appreciate any possible explanation and subsequent solution for this problem!

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
StatDave
SAS Super FREQ

The results are correct. Your age variable has 4 levels and therefore 3 degrees of freedom meaning that only 3 independent parameters can be estimated. The best, and easiest, way to do this is not to create separate indicator variables as you have done, but rather to create a single age variable with 4 distinct values indicating which range the observations fall in. Then, specify that single age variable in the CLASS and MODEL statement. The result will still show 3 parameter estimates for this 4 level variable. 

View solution in original post

2 REPLIES 2
StatDave
SAS Super FREQ

The results are correct. Your age variable has 4 levels and therefore 3 degrees of freedom meaning that only 3 independent parameters can be estimated. The best, and easiest, way to do this is not to create separate indicator variables as you have done, but rather to create a single age variable with 4 distinct values indicating which range the observations fall in. Then, specify that single age variable in the CLASS and MODEL statement. The result will still show 3 parameter estimates for this 4 level variable. 

Rick_SAS
SAS Super FREQ

I suspect that there are no valid responses for the 80+ group. You can use PROC FREQ to examine the crosstab:

proc freq data=Obesity;
tables Overall_Mortality*Age_80_ / nocol norow nopercent missing;
run;

I suggest that your analysis might be more interpretable if you create ONE categorical variable that has the age levels that you want. You can use PROC FORMAT to bin the Age variable into categories. Here is an example that uses the Sashelp.Class data:

 

proc format;
value AgeFmt  
      low -  13   = "11-13"
       14 -  16   = "14-16"
       17 -   high = "17+";  
run;
 
proc print data=Sashelp.Class;
   format Age AgeFmt.;
run;

proc glm data=Sashelp.Class;
   format Age AgeFmt.;
   class Age;
   model weight = Age / solution;
run;

 

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 2 replies
  • 1404 views
  • 2 likes
  • 3 in conversation