BookmarkSubscribeRSS Feed
Demographer
Pyrite | Level 9

 

Hi,

I have data set including population size by cohort, sex, region, and education levels (ordered from 0 to 5). I want to perform an ordered logit regression in order to estimate parameters that I can use to predict future cohorts.

 

My code:

proc sort data=work.edu; by sex; run;
proc logistic data=work.edu ;
class region / param = ref;
model edu_order(descending) = region cohort / unequalslopes;
weight pop;
by sex;
run;

 

When I run the code, I have an output, but parameters look wrong and I get this error

 

ERROR: Unable to compute derivatives for the Newton-Raphson step. You may want to use the INEST=
option to supply initial values for the parameter estimates, or try using Fisher's scoring
(TECHNIQUE=FISHER option)

 

I tried the TECHNIQUE=FISHER, but it doesn't work with unequalslopes. I have no idea how to use the INEST= option and the documentation is not very clear.

 

My dataset: https://www.dropbox.com/s/dstvlbm0ooesay9/edu.sas7bdat?dl=0

3 REPLIES 3
Rick_SAS
SAS Super FREQ

Your code treats COHORT as a continuous variable. Was that your intention? Otherwise, add COHORT to the CLASS statement.

 

Demographer
Pyrite | Level 9

Cohort need to be continuous, because I want a logit trend to predict the outcome of future cohort.

Rick_SAS
SAS Super FREQ

Your weights are badly scaled. The largest weight is about 1E5 and the smallest nonzero weight is 1. When the procedure computes the crossproduct matrix, it needs to compute X`WX, where W is the diagonal matrix of weights. This leads to uneven scaling when estimating the parameters.

 

I suggest you use the NORMALIZE option to scale the weight variable. Just change the WEIGHT statement to 

weight pop / normalize;

 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 3 replies
  • 713 views
  • 0 likes
  • 2 in conversation