Subscribe Bookmark RSS Feed

Logit: why aren't my exponentiated coefficients equaling my odds ratio (for nominal predictors)?

chriscic42

Community Trekker

Joined:

Nov 28, 2015

Not sure this question is really appropriate for this forum, but I'll go for it nonetheless : )

I'm running logit in JMP. My understanding is that if you exponentiate the coefficients, you get the change in odds ratios from a 1 unit change in X.

This works perfectly for continuous independent variables, but not for nominal (0,1) independent variables. Example below:

For parameter estimates I'm getting:

Term Estimate Intercept -1.516621
Gender[Female] 0.22189387

Level1 /Level2 Odds Ratio
Male Female 0.6416016
Female Male 1.5585996

Shouldn't my odds ratio for males be exp(-1.516621)=0.220486 and for females be exp(0.20461503)=1.2270525?

Befuddled by this. Would really appreciate some help. Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Solution

hi chriscic42​,

it would be more useful if you could give a data or at least the whole output.

meanwhile i suggest you define gender as ordinal and see the odds ratio makes more sense to you.

if you declare it nominal the coefficients are not contrasting one another but rather estimating the difference from the non weighted average between the categories.

if you declare it ordinal the coefficients estimate the difference between adjacent categories (in the gender case between the two) and i think that is what you are expecting to see.

running the model once with gender as nominal and once again as ordinal you are supposed to get essentially the same results in all but the coefficient for gender. using the nominal option you should get a coefficient which is half the size than the ordinal coefficient.

it is all about the way jmp constructs the contrasts between the categories.

hope this helps.

ron

4 REPLIES
Solution

hi chriscic42​,

it would be more useful if you could give a data or at least the whole output.

meanwhile i suggest you define gender as ordinal and see the odds ratio makes more sense to you.

if you declare it nominal the coefficients are not contrasting one another but rather estimating the difference from the non weighted average between the categories.

if you declare it ordinal the coefficients estimate the difference between adjacent categories (in the gender case between the two) and i think that is what you are expecting to see.

running the model once with gender as nominal and once again as ordinal you are supposed to get essentially the same results in all but the coefficient for gender. using the nominal option you should get a coefficient which is half the size than the ordinal coefficient.

it is all about the way jmp constructs the contrasts between the categories.

hope this helps.

ron

chriscic42

Community Trekker

Joined:

Nov 28, 2015

Thank you Ron!  That works!

It's a little counter-intuitive to me to treat gender like as an ordinal variable. Gender seems like the poster child for nominal. Does this mean than I should use ordinal for any two-level attribute (M/F, Married/Single, College grad/no college etc?). when running logit in JMP? When would I ever want to use nominal?

Also it seems very strange to me that when I use nominal, the coefficients appear to be "wrong" (i.e. you can't exponentiate them to get to the odds ratios) but the odds ratio still shows as the same either way (with nominal or ordinal variable). That just doesn't feel right given the way I thought the logit math works.

Sounds like you're saying this is a feature not a bug, and I don't presume to have enough knowledge to disagree, but it sure is confusing!

I'd be happy to share the data or model output (from the "wrong" version) but I can't figure out how to get it pasted in here without crazy messed up formatting.

Thanks again and let me know if you have additional thoughts!

ron_horne

Super User

Joined:

Jun 23, 2011

hi chriscic42​,

Perhaps you should look at it from a wider perspective. i get the impression jmp was built thinking big. in this case about more than two categories and therefore if a variable is nominal (most primitive categories that can't be ordered) it is desirable to compare them all to an "average" category. in which case the missing coefficient can be calculated by one minus the sum of the other coefficients (or just by requesting "expanded estimates" from the menu). meanwhile, for the ordinal it makes sense comparing each category to the one above it. in this case the coefficient for the missing category is just the intercept (the constant).

in addition, from my experience it is faster to set up the "value ordering" in the table beforehand than declaring the contrasts manually within the model platform as is common practice in other statistical software.

once the weekend is over i expect you will get some more thoughts of others on the forum.

ron

msharp

Super User

Joined:

Jul 28, 2015

There are many ways to add the data.  You could paste a screenshot directly into the forum post (which I do below) or you could use the Advanced Editor and attach the file. 

Often times many people simply post the data table code/analysis code since this allows one to quickly replicate your work without having to download any files.  You can get the script straight from the pop up menu in any data table:

10572_pastedImage_0.png