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

Hi,

 

I am running a logistic regression and I seem to have a discrepancy between the table of maximum likelihood estimates, and the table of odds ratios. The table of maximum likelihood estimates presents p values. Some of the parameters that are statistically significant according to the maximum likelihood estimates tables have 95% confidence intervals that include 1 according to the table of odds ratios. I always thought that if a confidence interval included 1 that was a sign that the odds ratio was not statistically significant. Am I wrong on this?

 

thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User
Yeah, you didn't specify PARAM=REF on the CLASS statement, try that. You also know you didn't need to recode your categorical variables? You could have used them as is, but you also know that if you had missing you've replaced those with 0's which may not accurately reflect your situation.And I'm also assuming you have a lot of observations, you need roughly 25 for each variable, and each level of a categorical variable counts as a variable, so you'll need a lot for this to be valid.

View solution in original post

6 REPLIES 6
Reeza
Super User
Possibly, it depends on how you parameterized your categorical variables. I'm guessing it's a categorical variable that has the issue? Post the code you used please.
AbuYusuf
Calcite | Level 5

Thank you for your response. The whole code is pretty lengthy, sorry for that. Lots of categorical variables, that's for sure.

 

data work.regs;
set work.regression;

 

/* Defining variables */
useservice = .;
if usednurse = 0 then useservice = 2;
else if usednurse = 1 then useservice = 1;

 

if x1 = "White" then race = 1;
else if x1 = "South Asian" then race = 2;
else if x1 = "Chinese" then race = 3;
else if x1 = "Black" then race = 4;
else if x1 = "Filipino" then race = 5;
else if x1 = "Latin American" then race = 6;
else if x1 = "Arab" then race = 7;
else if x1 = "Southeast Asian" then race = 8;
else if x1 = "West Asian" then race = 9;
else if x1 = "Korean" then race = 10;
else if x1 = "Japanese" then race = 11;
else if x1 = "Aboriginal" then race = 12;
else if x1 = "Other" then race = 13;

 

if x2 = "NO, NO DFICUTY" | x2 = "YES, DFICUTY, BUT NOT REQUIRE HELP" then housework = 1;
else if x2 = "YES, DFICUTY, BUT CAN DO IT W HELP" | x2 = "CANNOT DO IT AT ALL" then housework = 2;

 

if x3 = "NO, NO DFICUTY" | x3 = "YES, DFICUTY, BUT NOT REQUIRE HELP" then errands = 1;
else if x3 = "YES, DFICUTY, BUT CAN DO IT W HELP" | x3 = "CANNOT DO IT AT ALL" then errands = 2;

 

if x4 = "NO, NO DFICUTY" | x4 = "YES, DFICUTY, BUT NOT REQUIRE HELP" then personal = 1;
else if x4 = "YES, DFICUTY, BUT CAN DO IT W HELP" | x4 = "CANNOT DO IT AT ALL" then personal = 2;

 

if x5 = "NO, NO DFICUTY" | x5 = "YES, DFICUTY, BUT NOT REQUIRE HELP" then meals = 1;
else if x5 = "YES, DFICUTY, BUT CAN DO IT W HELP" | x5 = "CANNOT DO IT AT ALL" then meals = 2;
if meals = 0 then meals = .;

 

if x6 = "NO, NO DFICUTY" | x6 = "YES, DFICUTY, BUT NOT REQUIRE HELP" then finances = 1;
else if x6 = "YES, DFICUTY, BUT CAN DO IT W HELP" | x6 = "CANNOT DO IT AT ALL" then finances = 2;

 

/*if x7 = "NO, NO DFICUTY" then moving = 1;
else if x7 = "YES, DFICUTY, BUT NOT REQUIRE HELP" then moving = 2;
else if x7 = "YES, DFICUTY, BUT CAN DO IT W HELP" then moving = 3;
else if x7 = "CANNOT DO IT AT ALL" then moving = 4;*/

if x7 = "NO, NO DFICUTY" | x7 = "YES, DFICUTY, BUT NOT REQUIRE HELP" then moving = 1;
else if x7 = "YES, DFICUTY, BUT CAN DO IT W HELP" | x7 = "CANNOT DO IT AT ALL" then moving = 2;


adl = 0;
if housework = 1 | errands = 1 | personal = 1 | meals = 1 | finances = 1 | moving = 1 then adl = 1;
else if housework = 2 | errands = 2 | personal = 2 | meals = 2 | finances = 2 | moving = 2 then adl = 2;
else if housework = 3 | errands = 3 | personal = 3 | meals = 3 | finances = 3 | moving = 3 then adl = 3;
else if housework = 4 | errands = 4 | personal = 4 | meals = 4 | finances = 4 | moving = 4 then adl = 4;

 

if x8 = "under 15" then agecat = 1;
else if x8 = "15 to 35" then agecat = 2;
else if x8 = "35 to 55" then agecat = 3;
else if x8 = "55 to 65" then agecat = 4;
else if x8 = "65 to 75" then agecat = 5;
else if x8 = "75 to 85" then agecat = 6;
else if x8 = "85+" then agecat = 7;

 

if x9 = "No chronic conditions" then chronic = 1;
else if x9 = "1 or 2 chroni cconditions" then chronic = 2;
else if x9 = "3 to 5 chronic conditions" then chronic = 3;
else if x9 = "6 to 9 chronic conditions" then chronic = 4;
else if x9 = "10 or more chronic conditions" then chronic = 5;


if x10 = "MARRIED" then marital = 1;
else if x10 = "LIVNG COMMON-LAW" then marital = 2;
else if x10 = "WIDOWED" then marital = 3;
else if x10 = "SEPARATED" then marital = 4;
else if x10 = "DIVORCED" then marital = 5;
else if x10 = "SNGLE, NVR MARRIED" then marital = 6;

 

if x11 = "UNATCHD INDVDUL LIVNG ALONE" | x11 = "UNATCHD INDVDUL LIVNG W OTHRS" then efamstatus = 1;
else if x11 = "COUPLE ALONE" | x11 = "COUPLE W NO CHLDRN, OTHRS" then efamstatus = 2;
else if x11 = "COUPLE W CHLDRN LT 25" | x11 = "COUPLE W CHLDRN LT 25, OTHRS" | x11 = "COUPLE W ALL CHLDRN AGD 25+" | x11 = "COUPLE W ALL CHLDRN AGD 25+, OTHRS" then efamstatus = 3;
else if x11 = "FEM LONE PRNT W CHLDRN LT 25" | x11 = "FEM LONE PRNT W CHLDRN LT 25, OTHRS" | x11 = "FEM LONE PRNT W ALL CHLDRN AGD 25+, OTH" | x11 = "FEM LONE PRNT W ALL CHLDRN AGD 25+, OTH" then efamstatus = 4;
else if x11 = "MALE LONE PRNT W CHLDRN LT 25" | x11 = "MALE LONE PRNT W CHLDRN LT 25, OTHRS" | x11 = "MALE LONE PRNT W ALL CHLDRN AGD 25+" | x11 = "MALE LONE PRNT W ALL CHLDRN AGD 25+, OT" then efamstatus = 5;
else if x11 = "ALL OTHR HH TYPS" then efamstatus = 6;

 

if x12 = "LT $20,000" then income = 1;
else if x12 = "$20,000 TO LT $40,000" then income = 2;
else if x12 = "$40,000 TO LT $60,000" then income = 3;
else if x12 = "$60,000 TO LT $80,000" then income = 4;
else if x12 = "$80,000 AND MORE" then income = 5;

 

if x13 = "GR8 OR LOWR (QC: SEC 2 OR LOWR)" then educ = 1;
else if x13 = "GR9-10 (QUE: SEC 3/4; N.LL: SEC 1)" then educ = 2;
else if x13 = "GR11-13 (QUE: SEC 5; N.LL: SEC 2/3)" then educ = 3;
else if x13 = "SCNDRY SCHL GRDUTN, NO POST-SCDRY" then educ = 4;
else if x13 = "TRADE CERT OR DIP" then educ = 5;
else if x13 = "CERT/DIP - COLGE, CEGEP, ETC (NON-TRADE" then educ = 6;
else if x13 = "UNI CERT OR DIP BELOW B.A LVL" then educ = 7;
else if x13 = "BACHELORS DEGREE" then educ = 8;
else if x13 = "CERT/DIP/UNIV DEGREE ABVE B.A LVL" then educ = 9;

 

if x14 = "No depression" then depression = 1;
else if x14 = "Minimal depression" then depression = 2;
else if x14 = "Mild depression" then depression = 3;
else if x14 = "Moderate depression" then depression = 4;
else if x14 = "Moderately severe depression" then depression = 5;
else if x14 = "Severe depression" then depression = 6;

 

joint = 0;
if x15 = "YES" then joint = 1;
else if x15 = "No" then joint = 2;

 

asthma = 0;
if x16 = "YES" then asthma = 1;
else if x16 = "No" then asthma = 2;

 

COPD = 0;
if x17 = "YES" then COPD = 1;
else if x17 = "No" then COPD = 2;

 

slapnea = 0;
if x18 = "YES" then slapnea = 1;
else if x18 = "No" then slapnea = 2;

 

scoliosis = 0;
if x19 = "YES" then scoliosis = 1;
else if x19 = "No" then scoliosis = 2;

 

arthritis = 0;
if x20 = "YES" then arthritis = 1;
else if x20 = "No" then arthritis = 2;

 

fibromyalgia = 0;
if x21 = "YES" then fibromyalgia = 1;
else if x21 = "No" then fibromyalgia = 2;

 

back = 0;
if x22 = "YES" then back = 1;
else if x22 = "No" then back = 2;

 

osteo = 0;
if x23 = "YES" then osteo = 1;
else if x23 = "No" then osteo = 2;

 

blood = 0;
if x24 = "YES" then blood = 1;
else if x24 = "No" then blood = 2;

 

bloodmed = 0;
if x25 = "YES" then bloodmed = 1;
else if x25 = "No" then bloodmed = 2;

 

cholesterol = 0;
if x26 = "YES" then cholesterol = 1;
else if x26 = "No" then cholesterol = 2;

 

heart = 0;
if x27 = "YES" then heart = 1;
else if x27 = "No" then heart = 2;

 

stroke = 0;
if x28 = "YES" then stroke = 1;
else if x28 = "No" then stroke = 2;

 

cancer = 0;
if x29 = "YES" then cancer = 1;
else if x29 = "No" then cancer = 2;

 

diabetes = 0;
if x30 = "YES" then diabetes = 1;
else if x30 = "No" then diabetes = 2;

 

migraine = 0;
if x31 = "YES" then migraine = 1;
else if x31 = "No" then migraine = 2;

 

dementia = 0;
if x32 = "YES" then dementia = 1;
else if x32 = "No" then dementia = 2;

 

fatigue = 0;
if x33 = "YES" then fatigue = 1;
else if x33 = "No" then fatigue = 2;

 

sensitivities = 0;
if x34 = "YES" then sensitivities = 1;
else if x34 = "No" then sensitivities = 2;

 

mood = 0;
if x35 = "YES" then mood = 1;
else if x35 = "No" then mood = 2;

 

anxiety = 0;
if x36 = "YES" then anxiety = 1;
else if x36 = "No" then anxiety = 2;

 

rename x37 = age;

adlsum = housework + errands + personal + meals + finances + moving;

 

run;


/* With individual ADLs */
proc logistic data=work.regs plots=ROC plots= EFFECT;
class race moving personal finances errands personal meals housework adl adlsum income efamstatus marital dementia sensitivities COPD depression joint educ income chronic agecat anxiety mood fatigue fibromyalgia migraine diabetes cancer stroke heart cholesterol blood bloodmed back arthritis asthma scoliosis;

 

model useservice = race finances errands moving meals personal housework income efamstatus marital dementia sensitivities COPD depression joint educ income chronic agecat anxiety mood fatigue fibromyalgia migraine diabetes cancer stroke heart cholesterol blood bloodmed back arthritis asthma scoliosis / selection=backward;

weight WTS_S;
*format race race.;
format marital married.;
format efamstatus fam.;
format race race.;
format agecat age.;
format income inc.;
format depression dep.;
format adl activity.;
format educ educc.;
format chronic chrn.;
format joint chrcond.;
format anxiety chrcond.;
format mood chrcond.;
format fatigue chrcond.;
format fibromyalgia chrcond.;
format migraine chrcond.;
format COPD chrcond.;
format sensitivities chrcond.;
format cancer chrcond.;
format dementia chrcond.;
format heart chrcond.;
format diabetes chrcond.;
format stroke chrcond.;
format cholesterol chrcond.;
format blood chrcond.;
format bloodmed chrcond.;
format arthritis chrcond.;
format asthma chrcond.;
format scoliosis chrcond.;
format back chrcond.;
format errands activityN.;
format meals activityN.;
format personal activityN.;
format finances activityN.;
format moving activityN.;
format housework activityN.;

run;

Reeza
Super User
Yeah, you didn't specify PARAM=REF on the CLASS statement, try that. You also know you didn't need to recode your categorical variables? You could have used them as is, but you also know that if you had missing you've replaced those with 0's which may not accurately reflect your situation.And I'm also assuming you have a lot of observations, you need roughly 25 for each variable, and each level of a categorical variable counts as a variable, so you'll need a lot for this to be valid.
AbuYusuf
Calcite | Level 5

Thank you very much. It worked. Now only one parameter includes 1 (but it's just below 1). I read the description of the PARAM option and the reference cell coding, and I am not sure I understand what it does exactly.

 

One thing that worries me about this project is that the results really change depending on the method I use. One of my colleagues suggested I try proc genmod and the results were drastically different.

 

thank you for your help!

Reeza
Super User
It depends on the code you're running. Knowing nothing about your study or experiment I won't comment on what is appropriate.
AbuYusuf
Calcite | Level 5

if that helps, I am using survey data to evaluate the impact of ethnic background on home care utilization accounting for sociodemographic and health status characteristics. 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 6 replies
  • 1558 views
  • 0 likes
  • 2 in conversation