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-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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