1
$\begingroup$
install.packages("rms")
library(rms)

# fake data with formula, y = 4x1 + x2 + e
x1 <- runif(n = 1000, 0, 100)
x2 <- runif(n = 1000, 0, 10)
e <- rnorm(n = 1000, mean = 0, sd = 10)
df <- data.frame(x1, x2, e)
df$y <- 4*df$x1 + x2 + e

# rank y where max(y) is ranked 1
y.rank <- apply(-df, 2, rank, ties.method = "min")
df <- cbind(df, y.rank[ , 4])
names(df)[names(df)=="y.rank[, 4]"] <- "yrank"

# do ordinal logistic regression with lrm() in rms package of R
ddist <- datadist(df)
options(datadist = "ddist")
mdl.yrank <- lrm(yrank ~ x1 + x2, data = df)
summary(mdl.yrank)

         Effects              Response : yrank 

Factor      Low     High    Diff.   Effect      S.E.     Lower 0.95  Upper 0.95 
x1          23.9180 75.5830 51.6650 -3.7613e+01 1.028100 -3.9628e+01 -3.5598e+01
 Odds Ratio 23.9180 75.5830 51.6650  4.6222e-17       NA  6.1620e-18  3.4672e-16
x2           2.2514  7.2187  4.9673 -1.0035e+00 0.099966 -1.1994e+00 -8.0754e-01
 Odds Ratio  2.2514  7.2187  4.9673  3.6660e-01       NA  3.0137e-01  4.4595e-01

How should we interpret this summary? Does this mean, "moving from the bottom to the top of the inter-quartile range of x1 multiplies the odds ratio [of what concept] by 4.62222e-17"?

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.