3
$\begingroup$

The code below is to provide a reproducible example - however, this is not an R question, but a question about the formula/methodology (though if someone could provide the R code as well, that would be awesome).

I have a POLR model with a 4-level ordinal outcome.

library(MASS)

set.seed(2)
var1 <- sample(LETTERS[1:4], 100, replace = TRUE)
outcome <- sample(c("bad", "ok", "good", "great"), 100, replace = TRUE)
outcome <- factor(outcome, ordered = TRUE, levels = c("bad", "ok", "good", "great"))

df <- data.frame(var1, outcome)

mod1 <- polr(outcome ~ var1, Hess = TRUE, data = df)

mod1coeffs <- summary(mod1)$coefficients
pval <- (1-pnorm(abs(mod1coeffs[,"t value"]), 0, 1))*2
(mod1coeffs <- cbind(mod1coeffs, pval))

odds_ratio <- exp(mod1coeffs[, "Value"])
mod1coeffs <- cbind(mod1coeffs[,c("Value", "pval")], odds_ratio)
(mod1coeffs <- data.frame(mod1coeffs))

Output:

R>(mod1coeffs <- data.frame(mod1coeffs))
                 Value        pval odds_ratio
var1B      -0.41383640 0.394896754  0.6611091
var1C       0.05689622 0.911737772  1.0585460
var1D       0.37002901 0.461145889  1.4477766
bad|ok     -0.68350927 0.052608937  0.5048423
ok|good     0.06629081 0.846102876  1.0685374
good|great  1.15528574 0.001413507  3.1749305

I could report the outcome by saying that compared to Var1A, Var1B decreases the odds for a better outcome by 66%. However, this is in a business context and the first question I am going to get is "what is that in probabilities?". I am, of course, aware of the p = o / 1 + o formula, but as I understand it, that is for probability from odds, not odds-ratios. I have tried to read up on the internet on this, but all I'm getting is "to convert odds-ratios to probabilities you need more information, which is included in your model". What other information and where is it included? Can someone please help me calculate the probabilities? Ideally, I would like to say something like compared to Var1A, Var1B decreases the probability for a better outcome by xx%. Thank you very much!

$\endgroup$

1 Answer 1

5
$\begingroup$

The information is in the intercepts, which you can find by typing

mod1

You then can use the formula to compute the probabilities

$P(DV = level) = \frac{1}{1 + e^{-(intercept + coef*var1}}$

plugging in appropriate values for intercept and coef.

With only one categorical independent variable, it seems like you could just make a table, but that won't work well for more complex models, or those with continuous variables.

$\endgroup$
3
  • $\begingroup$ Thank you very much, Peter, for the response, much appreciated. Just a quick clarification: I assume that coef*var1 means the coefficient of var 1 at the right level, i.e. in the above case the coefficient of Var1B (-0.41383640)? $\endgroup$ Commented yesterday
  • $\begingroup$ Yes. That would be the coefficient to get the probability for level B $\endgroup$ Commented yesterday
  • $\begingroup$ Thank you very much, Peter. This has been huge help and I truly appreciate you taking the time to answer my question. $\endgroup$ Commented yesterday

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.