Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9208441
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:37:09+00:00 2026-06-18T00:37:09+00:00

I have got a question regarding the ordinal package in R or specifically regarding

  • 0

I have got a question regarding the ordinal package in R or specifically regarding the predict.clm() function. I would like to calculate the linear predictor of an ordered probit estimation. With the polr function of the MASS package the linear predictor can be accessed by object$lp. It gives me on value for each line and is in line with what I understand what the linear predictor is namely X_i’beta. If I however use the predict.clm(object, newdata,"linear.predictor") on an ordered probit estimation with clm() I get a list with the elements eta1 and eta2,

  1. with one column each, if the newdata contains the dependent variable
  2. where each element contains as many columns as levels in the dependent variable, if the newdata doesn’t contain the dependent variable

Unfortunately I don’t have a clue what that means. Also in the documentations and papers of the author I don’t find any information about it. Would one of you be so nice to enlighten me? This would be great.

Cheers,

AK

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T00:37:10+00:00Added an answer on June 18, 2026 at 12:37 am

    UPDATE (after comment):

    Basic clm model is defined like this (see clm tutorial for details):

    Generating data:

    library(ordinal)
    set.seed(1)
    test.data = data.frame(y=gl(4,5),
                           x=matrix(c(sample(1:4,20,T)+rnorm(20), rnorm(20)), ncol=2))
    head(test.data) # two independent variables 
    test.data$y     # four levels in y
    

    Constructing models:

    fm.polr <- polr(y ~ x) # using polr
    fm.clm  <- clm(y ~ x)  # using clm
    

    Now we can access thetas and betas (see formula above):

    # Thetas
    fm.polr$zeta # using polr
    fm.clm$alpha # using clm
    # Betas
    fm.polr$coefficients # using polr
    fm.clm$beta          # using clm
    

    Obtaining linear predictors (only parts without theta on the right side of the formula):

    fm.polr$lp                                                 # using polr
    apply(test.data[,2:3], 1, function(x) sum(fm.clm$beta*x))  # using clm
    

    New data generation:

    # Contains only independent variables
    new.data <- data.frame(x=matrix(c(rnorm(10)+sample(1:4,10,T), rnorm(10)), ncol=2))
    new.data[1,] <- c(0,0)  # intentionally for demonstration purpose
    new.data
    

    There are four types of predictions available for clm model. We are interested in type=linear.prediction, which returns a list with two matrices: eta1 and eta2. They contain linear predictors for each observation in new.data:

    lp.clm <- predict(fm.clm, new.data, type="linear.predictor")
    lp.clm
    

    Note 1: eta1 and eta2 are literally equal. Second is just a rotation of eta1 by 1 in j index. Thus, they leave left side and right side of linear predictor scale opened respectively.

    all.equal(lp.clm$eta1[,1:3], lp.clm$eta2[,2:4], check.attributes=FALSE)
    # [1] TRUE
    

    Note 2: Prediction for first line in new.data is equal to thetas (as far as we set this line to zeros).

    all.equal(lp.clm$eta1[1,1:3], fm.clm$alpha, check.attributes=FALSE)
    # [1] TRUE
    

    Note 3: We can manually construct such predictions. For instance, prediction for second line in new.data:

    second.line <- fm.clm$alpha - sum(fm.clm$beta*new.data[2,])
    all.equal(lp.clm$eta1[2,1:3], second.line, check.attributes=FALSE)
    # [1] TRUE
    

    Note 4: If new.data contains response variable, then predict returns only linear predictor for specified level of y. Again we can check it manually:

    new.data$y <- gl(4,3,length=10)
    lp.clm.y <- predict(fm.clm, new.data, type="linear.predictor")
    lp.clm.y
    
    lp.manual <- sapply(1:10, function(i) lp.clm$eta1[i,new.data$y[i]])
    all.equal(lp.clm.y$eta1, lp.manual)
    # [1] TRUE
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have got a question regarding suprepositories. Our project is set up like this:
I would like to ask a quick question regarding a mysql query. I have
got a question regarding serializing classes that I've defined. I have some classes like
I am (very) new to WPF and I have got a question regarding that.
i've got a question regarding the imrect() function, which is part of the image
I've got a question regarding multiple-thread method invocation in Java. Let's say we have
I have a question regarding C, would appreciate those who are willing to share
I have got just a quick question regarding the header hierarchy when using HTML5
I've got a question about CakePHP and databases regarding an application idea I have.
I have a question regarding JSF conversion. I have an input text define like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.