[R] effects() extractor for a quantile reqression object: error message
Martin Maechler
m@ech|er @end|ng |rom @t@t@m@th@ethz@ch
Fri Sep 6 10:04:11 CEST 2024
>>>>> Christopher W Ryan via R-help
>>>>> on Thu, 5 Sep 2024 22:50:24 -0400 writes:
> I'm using quantreg package version 5.98 of 24 May 2024, in R 4.4.1 on
> Linux Mint.
> The online documentation for quantreg says, in part, under the
> description of the rq.object, "The coefficients, residuals, and effects
> may be extracted by the generic functions of the same name, rather than
> by the $ operator."
> I create an rq object for the 0.9 quantile, called qm.9
> effects(qm.9)
> yields, the error message, " effects(qm.9)
> Error in UseMethod("effects") :
> no applicable method for 'effects' applied to an object of class "rq"
> I'm confused. Appreciate any suggestions. Thanks.
> --Chris Ryan
Unfortunately, the documentation is wrong, here.
You can always use
methods(class = class(qm.9))
to get list of generic function names for there is a method for
your object (of class "rq") in this case...
and indeed, "effects" is not among them.
Possibly this was a thinko (on the 'rq.object' help page) and
it was "predict" that was meant there,
as indeed there is a predict method (actually there are even 3
different predict() methods in package 'quantreg', and they are
well documented on the ?predict.qr help page.
{OTOH my guess is that there originally *was* an effects method
and it has been dropped in the mean time}
Martin Maechler
ETH Zurich and R Core team
More information about the R-help
mailing list