1
$\begingroup$

I am using the polr() function in R to analyze the relationship between a students score on their first exam, their score in their prerequisite course, and their beginning of semester GPA on their final grade in their current course. The code would look something like this:

GradeProp <- polr(CurrentGrade ~ FirstExam + PreReqGrade + GPA,
                                  method='logistic', Hess=TRUE, data=xyz)

I am able to interpret these results without too much issue.

When I include interaction terms, say something like:

GradeProp <- polr(CurrentGrade ~FirstExam + PreReqGrade +GPA + GPA*PreReqGrade,
method='logistic', Hess=TRUE, data=xyz)

I am not confident about how to interpret the interaction term GPA*PreReqGrade. All terms are significant. GradeProp, the response variable, is set to 1,2,3,4,5 for F,D,C,B,A grades. Here is an example output from R (I changed the signs of the terms already!)

               Value
CurrentGrade     0.063634
GPA              0.006205
PreReqGrade      0.030567
GPA:PreReqGrade  -0.00259
1|2              -2.96141
2|3              -1.76561
3|4              -0.28012
4|5               1.55617

Can someone please, please write an explanation for this output? I have read and read about this. It seems as though one source will skim right past it, and another will just give the answer without any explanation where it came from. I really need to know how to calculate the odds and probabilities when there is an interaction term (or two) in a Proportionals Odds Cumulative Logistic Model. Model information: here.

$\endgroup$

2 Answers 2

2
$\begingroup$

You may find the lrm and orm functions in the R rms package easier to use for these types of displays. Type ?Predict.rms and ?ggplot.Predict for example code for getting predictions and interest and plotting them. The most general approach is using contrasts: ?contrast.rms.

Note that in R when you have a * interaction term you don't also list the main effects as these are automatically generated.

$\endgroup$
2
$\begingroup$

There is a very similar question here, regarding an interaction between categorical and continuous variables. Even though your example is with polr() and not lm(), the logic is the same, as it appears you are already comfortable interpreting coefficients in a logistic regression. What you need to do is calculate the marginal effect. The 'effects' package is helpful for this and works very well with polr() specifications:

library(effects)
plot(allEffects(mod))

A plot will likely be the best way for you to visualize and communicate your results. When you include an interaction term, you cannot interpret your summary() output the same way. For example, PreReqGrade may be significant over some letter grades but not over others. Just looking at your summary() output will not give you this information.

If you feel like your references are skimming over this, then what you should do is to look up and try to understand what a marginal effect is -- see also literature referenced in this post.

One final comment on your question: Current grade appears to be a letter grade (ordinal), but PreReqGrade appears to be continuous. Is this a numerical grade, or did you forget to factor it?

Just to note as well, @FrankHarrell is also absolutely correct. He literally wrote the book on this... I just wanted to give you some links for further reading, to try to help you understand what some of these R function with interaction terms are actually doing.

$\endgroup$
1
  • $\begingroup$ Thanks for sharing. The function plot(allEffects(mod)) produced a diagram for an ordinal regression model created with polr() from the MASS package. Nice. The diagram was hard to read though. The individual graphs overlapped. So one has to have either a model with only 2 predictors with few levels or have an extremely large screen. I sort of managed, but am looking to fine tune the function to have legible plots $\endgroup$
    – Simone
    Commented Oct 5, 2023 at 14:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.