BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
astudent
Fluorite | Level 6

Hello,

 

I have this code:

proc logistic data=home.finaldata;
class SocIsoSS Age2 MarSta MinNum00_1/ param=ref;
model HHFS2_short= SocIsoSS Age2 MarSta MinNum00_1;
run;

 

HHFS2_short (secure) is coded as 0=yes 1=no while SocIsoSS (isolation) 0=no, 1=yes.

 

This is my output:

 

Analysis of Maximum Likelihood EstimatesParameter   DF Estimate StandardError WaldChi-Square Pr > ChiSqIntercept  SocIsoSS 0Age2 1MarSta 1MinNum00_1 0
astudent_1-1726716358198.png

 

 

What I think is the interpretation is that isolated individuals are more likely to be secure compared to those who are to isolated. since the probability being modeled is HHFS2_short=0.  However, When I do a chisquare it looks like isolated individuals are more insecure than those who are not isolated which is the opposite of the logistics regression results. 

 

Here are the chisquare results:

astudent_2-1726716427045.png

 

I removed the covariates in the logistic model to see if it made any difference, but the results are still the same. Is there something I am interpreting incorrectly?

1 ACCEPTED SOLUTION

Accepted Solutions
StatDave
SAS Super FREQ
Notice that the parameter for SocisoSS is for the 0 level as indicated by the 0 immediately between the variable name and the DF column. So, this positive parameter means that no isoloation (SocisoSS=0) increases the log odds (and probability) of being secure (HHFS2_short=0).

Whenever you model a binary response, either with PROC LOGISTIC or any of the other procedures that can fit such models, you should ALWAYS use the EVENT= response option to specifically set the level of the response that you are modeling. This will let you be sure of what you are modeling and to ease interpretation. It is also useful to use the REF= option following each CLASS variable to specify the reference level for that variable. So, interpretation might be more intuitive for you with this code (you might want to specify REF= for the other CLASS variables too):

proc logistic data=home.finaldata;
class SocIsoSS(ref='0') Age2 MarSta MinNum00_1/ param=ref;
model HHFS2_short(event='0')= SocIsoSS Age2 MarSta MinNum00_1;
run;

Alternatively for 0,1-coded predictors, it is easier to just remove them from the CLASS statement since they are already dummy variables and don't need the CLASS statement to make a new dummy variable for them.

View solution in original post

4 REPLIES 4
Ksharp
Super User
Maybe the refered level of Y variable is reversed.
model HHFS2_short(event='0')= SocIsoSS Age2 MarSta MinNum00_1;
and
model HHFS2_short(event='1')= SocIsoSS Age2 MarSta MinNum00_1;
has reverse result.
Make sure which level of Y you want to model.
FreelanceReinh
Jade | Level 19

Hello @astudent,

 


@astudent wrote:

What I think is the interpretation is that isolated individuals are more likely to be secure compared to those who are to isolated. since the probability being modeled is HHFS2_short=0.

 

Why do you think that? The estimated odds ratio of 3.450 of "SocIsoSS 0 vs. 1" for being secure (HHFS2_short=0) and its lower confidence limit are clearly greater than one, so -- adjusted for the other covariates -- we would expect a significantly higher percentage of "secure" individuals in the subgroup "SocIsoSS=0" ("non-isolated") than in the subgroup "SocIsoSS=1" ("isolated"). This is consistent with your cross tabulation of SocIsoSS and HHFS2_short: The corresponding empirical odds ratio ignoring the other covariates is 151*125/(58*79)=4.119... (again, clearly greater than 1) and the percentages of "secure" individuals are 65.65 (among the "non-isolated") vs. 31.69 (among the "isolated").

StatDave
SAS Super FREQ
Notice that the parameter for SocisoSS is for the 0 level as indicated by the 0 immediately between the variable name and the DF column. So, this positive parameter means that no isoloation (SocisoSS=0) increases the log odds (and probability) of being secure (HHFS2_short=0).

Whenever you model a binary response, either with PROC LOGISTIC or any of the other procedures that can fit such models, you should ALWAYS use the EVENT= response option to specifically set the level of the response that you are modeling. This will let you be sure of what you are modeling and to ease interpretation. It is also useful to use the REF= option following each CLASS variable to specify the reference level for that variable. So, interpretation might be more intuitive for you with this code (you might want to specify REF= for the other CLASS variables too):

proc logistic data=home.finaldata;
class SocIsoSS(ref='0') Age2 MarSta MinNum00_1/ param=ref;
model HHFS2_short(event='0')= SocIsoSS Age2 MarSta MinNum00_1;
run;

Alternatively for 0,1-coded predictors, it is easier to just remove them from the CLASS statement since they are already dummy variables and don't need the CLASS statement to make a new dummy variable for them.
astudent
Fluorite | Level 6

This was very helpful. Thank you so much.

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
  • 4 replies
  • 364 views
  • 4 likes
  • 4 in conversation