+ Reply to Thread
Results 1 to 3 of 3

Thread: Hypothesis testing multiple quantiles in quantile regression (quantreg package)

  1. #1
    Points: 1,980, Level: 26
    Level completed: 80%, Points required for next Level: 20
    derksheng's Avatar
    Posts
    247
    Thanks
    49
    Thanked 35 Times in 28 Posts

    Hypothesis testing multiple quantiles in quantile regression (quantreg package)




    Consider a simple quantile regression with 1 regressor. I want to do two things:

    1) Compare whether the slope parameter is equal \forall \tau \in \{0.1,0.2,0.3,\dotsc,0.7,0.8,0.9\}

    2) Do the same over all \tau \in \{0.01,0.02,\dotsc,0.98,0.99\}.

    I've identified anova(model1,model2,model3) as being a way that works, where model1 is the "rq" object (quantile regression fit) over \tau_1. However, for the test over 9 quantiles I don't want to type anova(model1,model2,......,model9), and for the test over 99 quantiles I don't want to do it for 99 models.

    I've tried generating a list of length 9 and 99 (for my two goals) using lapply() over different \tau's. However, anova() won't accept this.

    I've also tried working with object "rqs" instead of default "rq". However, that doesn't work either. FYI here is how you generate an "rqs" object. It's basically an "rq" regression over all specified quantiles within 1 object. So I'll generate it for the 99 quantiles.

    Code: 
    y = rnorm(100)
    x = rnorm(100)
    
    rqs_object <- rq(y~x,tau=1:99/100)
    Here's an example of an "rq" object (the one that works with anova()):

    Code: 
    y = rnorm(100)
    x = rnorm(100)
    
    rq_object <- rq(y~x,tau=0.5) #median regression
    So how do I get this to work? I see that anova.rq in the package accepts rqlist object type but extensive google searching still has not revealed what this object type is.
    Last edited by derksheng; 08-24-2012 at 01:23 AM.

  2. #2
    Phineas Packard
    Points: 9,932, Level: 66
    Level completed: 71%, Points required for next Level: 118
    Lazar's Avatar
    Location
    Sydney
    Posts
    966
    Thanks
    162
    Thanked 261 Times in 236 Posts

    Re: Hypothesis testing multiple quantiles in quantile regression (quantreg package)

    What about the default graphing function for quantreg models. My vague memory from using it a couple of years ago is that the default plot gives an indication of which slopes are significantly above or below the ols regression line.

  3. #3
    Points: 1,980, Level: 26
    Level completed: 80%, Points required for next Level: 20
    derksheng's Avatar
    Posts
    247
    Thanks
    49
    Thanked 35 Times in 28 Posts

    Re: Hypothesis testing multiple quantiles in quantile regression (quantreg package)


    plot() accepts rqs perfectly fine.

    anova() (or, equivalently, "anova.rq" in the quantreg documentation) doesn't.

    The head author has requested formal joint hypothesis testing as well as plots.

    I think I just need a way to create something that contains all 99 models that anova() will accept without typing out anova(model1,model2...........).

+ Reply to Thread

           




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts






Advertise on Talk Stats