0

I estimated the 0.1 conditional quantile of a linear regression model previously estimated by OLS by applying rq. The original data consists of 8760 rows (hourly data for one year).

> require("quantreg")
> Qr_0.1 = rq(Reg_OLS, tau=0.1)

I now want to use the estimated model to predict a much smaller timespan:

> Qrpredict_0.1 = predict.rq(Qr_0.1, newdata)

But it results in the following warning message:

Warning message:'newdata' had 192 rows but variables found have 8760 rows

The result I get consists of 8760 rows. And it seems like it just uses the old data.

What exactly is the problem here and is there a way to deal with this?

Edit: It works perfectly fine when I use new data with the same number of rows.

shenflow
  • 345
  • 2
  • 12
  • That is a *warning* message not error. Does `predict.rq` not yield a result? – Parfait Feb 08 '18 at 20:47
  • It yields a result that I do not understand and it consists of 8760 rows so it is definetly not the desired one. – shenflow Feb 08 '18 at 20:58
  • @Parfait and by the way: It works perfectly fine when I use a new dataframe with the same number of rows. – shenflow Feb 08 '18 at 21:17
  • Is your `rq()` correct? Where is x, y, or formula? Maybe this affects latter `predict.rq`. Please set up a [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) – Parfait Feb 09 '18 at 04:34

0 Answers0