Skip to content

NextMethod in boxcox

11 messages · Bert Gunter, Thomas Lumley, Gene Leynes +1 more

#
Have you tried:

?NextMethod

?

-- Bert

Bert Gunter
Genentech Nonclinical Biostatistics
(650) 467-7374

"Data is not information. Information is not knowledge. And knowledge
is certainly not wisdom."
H. Gilbert Welch
On Thu, Feb 13, 2014 at 2:17 PM, Gene Leynes <gleynes+r at gmail.com> wrote:
#
Well, since this is really a question about understanding how S3
methods work, and this is not the place for a tutorial, I think what
you need to do is search out a tutorial that you understand.

But very briefly, it does what it says. The "object" argument is
supplied to the boxcox generic; lm() takes this (presumably a formula)
as an argument and replaces the object argument with the fit, which is
of "lm" class . NextMethod() then would call the next method,
boxcox.lm on "object" . boxcox.lm does something similar, calling
boxplot.default on the (possibly fixed up) fit, as that is the "next"
method after boxplot.lm on "object."  boxplot.default is where all the
work is done.

*** If this is wrong in any way, I would appreciate being corrected.***

Others may have useful tutorials that provide greater detail.

Cheers,
Bert

Bert Gunter
Genentech Nonclinical Biostatistics
(650) 467-7374

"Data is not information. Information is not knowledge. And knowledge
is certainly not wisdom."
H. Gilbert Welch
On Fri, Feb 14, 2014 at 2:00 PM, Gene Leynes <gleynes+r at gmail.com> wrote:
#
Inline.

Bert Gunter
Genentech Nonclinical Biostatistics
(650) 467-7374

"Data is not information. Information is not knowledge. And knowledge
is certainly not wisdom."
H. Gilbert Welch
On Fri, Feb 14, 2014 at 4:19 PM, Gene Leynes <gleynes+r at gmail.com> wrote:
Study the tutorials. You still don't appear to get it.

Of course there is a boxcox.default. ?methods
methods(boxcox)

It is not exported from MASS so must be accessed via ":::"
?"::"

-- Bert
Yes. Thanks.
#
However, note that I DID get it WRONG:

The method invoked by the NextMethod() call in the boxcox.formula
method is boxcox.default, NOT boxcox.lm.

Cheers,
Bert



Bert Gunter
Genentech Nonclinical Biostatistics
(650) 467-7374

"Data is not information. Information is not knowledge. And knowledge
is certainly not wisdom."
H. Gilbert Welch
On Fri, Feb 14, 2014 at 5:07 PM, Bert Gunter <bgunter at gene.com> wrote:
#
On Feb 14, 2014, at 11:04 PM, Gene Leynes wrote:

            
http://cran.r-project.org/doc/Rnews/Rnews_2006-4.pdf
Please learn to post in plain text. (It's really very easy in gmail.)