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

  • SEARCH
  • Home
  • 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 8456785
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T12:38:15+00:00 2026-06-10T12:38:15+00:00

I have a quantile regression model with 1 regressor and 1 regressand. I want

  • 0

I have a quantile regression model with 1 regressor and 1 regressand. I want to hypothesis test that the regressor is equal over every quantile. One approach I’ve thought of is to test over all tau over {0.01,0.02,….,0.99}. However, I would then have to write:

anova(model1,model2,model3,.......,model99), where each model corresponds to a different tau. Question: How do I get anova() to accept large amount of models of type rq without manually typing them out?


My attempt at a solution has been to do this:

y = rnorm(100)
x = rnorm(100)

rqs_object <- rq(y~x,tau=1:99/100)
anova(rqs_object)

However, anova clearly doesn’t take object type rqs, only type rq, unfortunately.


Cross posted here until I decided that it had a large programming/specialist element to the problem .

  • 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-10T12:38:17+00:00Added an answer on June 10, 2026 at 12:38 pm

    I concentrate on question 1 and only on the programming part.

    some data:

    set.seed(65465)
    y = rnorm(100)
    x = rnorm(100)
    

    Now I define a function, that takes tau as input and does the fit:

    rqfits <- function(tau) {
      require(quantreg)
      rq(y~x,tau=tau)
    }
    

    I can then apply this function on a vector of taus:

    taus <- 1:5/10
    fits <- lapply(taus,rqfits)
    

    The result is a list of models.
    We can now use do.call to pass our models to anova:

    do.call(anova,fits)
    
    Quantile Regression Analysis of Deviance Table
    
    Model: y ~ x
    Joint Test of Equality of Slopes: tau in {  0.1 0.2 0.3 0.4 0.5  }
    
      Df Resid Df F value Pr(>F)
    1  4      496  1.0388 0.3866
    Warning:
    In summary.rq(x, se = se, covariance = TRUE) : 2 non-positive fis
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say have a linear model LM that I want a qq plot of the
So I have some lidar data that I want to calculate some metrics for
have written this little class, which generates a UUID every time an object of
Have deployed numerous report parts which reference the same view however one of them
I have a MATLAB routine with one rather obvious bottleneck. I've profiled the function,
I have 40 subjects, of two groups, over 15 weeks, with some measured variable
Have a SQL problem, adding this model all works correctly, the problem is in
I've been mystified by the R quantile function all day. I have an intuitive
I'm writing a Hadoop application but it seems that I have misinterpreted how exactly
I have the following ggplot2 code that plots the ribbon from the 3rd to

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.