I am trying to run PROC LOGISTIC in order to model the incidence of a disease (cases per 100k people) as a function of birthing order and age of the mother at time of birth.
I have included a table below to illustrate the structure of my data. Please note that the re-coded variables at the far right (p100k, mage1, bdisorder1) are the variables that will be used in the model.
obs maternal age Birth Ord Outcome count Total subjects cases per 100k people (p100k) mage1 bdisorder1
1 | 20-24 | 1 | 128 | 329462 | 38.851 | 0 | 0 |
---|---|---|---|---|---|---|---|
2 | 20-24 | 2 | 152 | 326735 | 46.521 | 1 | 0 |
3 | 20-24 | 3 | 71 | 175682 | 40.414 | 2 | 0 |
4 | 25-29 | 1 | 54 | 114987 | 46.962 | 0 | 1 |
5 | 25-29 | 2 | 112 | 208692 | 53.668 | 1 | 1 |
6 | 25-29 | 3 | 101 | 207060 | 48.778 | 2 | 1 |
7 | 30-34 | 1 | 41 | 39473 | 103.868 | 0 | 2 |
8 | 30-34 | 2 | 79 | 83224 | 94.925 | 1 | 2 |
9 | 30-34 | 3 | 109 | 117312 | 92.915 | 2 | 2 |
10 | 35-39 | 1 | 38 | 14202 | 267.568 | 0 | 3 |
11 | 35-39 | 2 | 89 | 28478 | 312.522 | 1 | 3 |
12 | 35-39 | 3 | 99 | 45015 | 219.927 | 2 | 3 |
13 | 40+ | 1 | 22 | 3046 | 722.259 | 0 | 4 |
14 | 40+ | 2 | 44 | 5381 | 817.692 | 1 | 4 |
15 | 40+ | 3 | 83 | 8654 | 959.094 | 2 | 4 |
So here is the program I am trying to run:
PROC LOGISTIC DATA=WORK.DATASET DESCENDING;
FREQ COUNT;
CLASS mage1 (REF="0") bdisorder1 (REF="0") / PARAM=REF;
MODEL p100k = mage1 bdisorder1 / LINK = LOGIT AGGREGATE DETAILS ALPHA=0.05;
TITLE1 "Main Effects Model - PROBLEM 1";
RUN;
Since I've recoded the mage1 and bdisorder1 variable to have my referent categories as zero instead of one I'm pretty sure I don't need the reference indicators in my class statement. I'm trying to use dummy variables for these two inputs which is what I think I'm doing with the class statement. Unfortunately my model won't converge and I keep getting the following warning: "WARNING: The information matrix is singular and thus the convergence is questionable. Try specifying a larger SINGULAR= value."
Is it that my data becomes too highly stratified if I try to use dummy variables for both of my inputs?
Any help/thoughts on this topic is greatly appreciated.
When using aggregate data, you need to specify the model as
MODEL
events/trials = <effects> </ options> ;
so something like
MODEL outcome count/total subjects = mage1 bdisorder1/....
is called for. RTFM.
When using aggregate data, you need to specify the model as
MODEL
events/trials = <effects> </ options> ;
so something like
MODEL outcome count/total subjects = mage1 bdisorder1/....
is called for. RTFM.
Two problems are obvious in your code. 1) the column names are inverted for your dummy variables. But that would not affect convergence. 2) The MODEL statement should use the event/trial syntax :
MODEL outcomeCount / totalSubjects = mage1 bdisorder1 / LINK = LOGIT DETAILS ALPHA=0.05;
That might be enough to solve your problem.
PG
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.