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

1)

2)

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.

Here's an example of an "rq" object (the one that works with anova()):

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.

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)
```

Code:

```
y = rnorm(100)
x = rnorm(100)
rq_object <- rq(y~x,tau=0.5) #median regression
```

Last edited: