cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar
Duane_Hayes
Staff (Retired)
Obtaining and interpreting odds ratios for interaction terms in JMP

Odds ratios in a logistic regression model are used to interpret the effect of the factors included in the model.Odds ratios in a logistic regression model are used to interpret the effect of the factors included in the model.

Logistic regression models are widely used throughout industry and academia. They are appropriate when one is attempting to model a binary response (Yes/No, Live/Die, Good/Bad…) or an ordinal response where ordering of the levels is important (Good/Better/Best, Mild/Moderate/Severe, etc.) Odds ratios in these models are used to interpret the effect of the factors included in the model.

Odds ratios for interaction terms are more difficult to compute and to interpret because of the properties of the odds ratio. With an interaction term, there is no single odds ratio. To get an odds ratio for one of the main effects involved in the interaction, you must define a fixed level of the other effect. That is, if you want an odds ratio for an effect A, when the interaction term A*B is included in the model, you must fix the level of B to compute the desired odds ratio.

Analyses in JMP are no different. To demonstrate, let’s look at an example. The (simulated) data shown below was collected from 100 individuals, measuring their Gender, Age, and if they have experienced low back pain in the prior six months.

 

Partial display of the data collected.Partial display of the data collected.

 

Fitting the Model

In this simple example, a logistic regression model can be fit with “Pain” being the response variable, and the effects included in the model are “Age,” “Gender,” and the “Age” by “Gender” interaction term. The interaction term is included because the belief exists that as age increases, males and females do not respond the same. The response level Pain=”Yes” will be modeled as the event of interest. This model can be set up in JMP by selecting Analyze—>Fit Model and defining the terms as shown in the launch dialog below. Note that the response column “Pain” has a Nominal Modeling Type. This designation is necessary for the analysis.

 

Defining the Logistic Regression model.Defining the Logistic Regression model.

From the results shown, select “Save Probability Formula” from the Nominal Logistic Fit pop up menu. This selection will generate new columns in the original data table: 

          Lin[Yes] – The linear predictor, or the predicted logit function

          Prob[Yes] – The predicted probability of the response being “Yes”

          Prob[No] – The predicted probability of the response being “No”

          Most Likely Pain – The predicted level of the response

Saving the Probability Formula.Saving the Probability Formula.

Obtaining the Odds Ratios

Formulas will be associated with each of these columns. In order to obtain customized odds ratios, create new rows in the data table defining the comparison settings. Here, there is interest in determining the odds ratio of 55-year-old males versus 65-year-old males, and 60-year-old males versus 60-year-old females.  See the data table below to see the additional rows with the formulas described above evaluated.

 

Added rows to compute customized odds ratios.Added rows to compute customized odds ratios.

Now, the first odds ratio is computed as:

          OR = Exp(0.297472046-(-0.292264161)) = 1.8035

This odds ratio of 1.8035 indicates that the odds of pain increase by a factor of 1.8035 for males as age increases from 55 to 65.

The second odds ratio of interest is computed as: 

          OR = Exp(0.0026039423-(-2.466015867)) = Exp(2.46861981) = 11.8061

This odds ratio of 11.8061 indicates that the odds of pain for 60-year-old males is 11.8061 times higher than for 60-year-old females. For a more detailed description of odds ratios, please review the JMP 14 online documentation on this topic.

These computations demonstrate a method of obtaining customized odds ratios for logistic regression models using JMP software. This method is not limited to interaction terms only; it can be used with main effects. So, the default odds ratios given in JMP may be just fine in some situations. In many cases, the tests of interest must be defined by hand, and the method described here will always get these tests of interest.

Last Modified: Jul 30, 2018 3:59 PM
Comments
Kfuenzal
Level I

Hello, thank you for your explain. I have two questions:

1) In the first example you calculated the odd ratio of suffering pain in 55 years old man versus 65. Here you have a single set of data. If I have for example a dataset with a biomarker (continuos value) and cancer manifestation (yes or not), but a I Have a lot of observations with the same value for the biomarker or are below or above a cutoff value (COV) I will have many linear prediction results of my observations that will be under or upper de COV. In this case, If I want to determine de probabbility to present cancer having a value upper COV vs lower de COV, should a calculate the average of prediction (LinYes) for all values under and lower than COV and the calculate the ODD ratio applying the formula?

2) Can I use also categoric variables for calculating the probability of a condition. For example. when I use the biomarker "A" as continuos variable, together with other biomarkers "b" and "C" and apply a Fit model, in the summary of effects, the p value decreases if I change the biomarker A as categoric variable assigned it as lower or higher the COV. Can I use this criteria?

Thank you so much

Duane_Hayes
Staff (Retired)

@Kfuenzal 

 

You could always create a binary variable with two values:  "below cutoff / above cutoff" and include it in the model. Doing so, you lose information of the actual measured data. That could be the reason the p-values differ when looking at categorical effects vs. continuous effects.