[R] why delete.response?

ripley@stats.ox.ac.uk ripley at stats.ox.ac.uk
Sat Aug 24 07:05:07 CEST 2002


On Fri, 23 Aug 2002, Saket Joshi wrote:

> Hi all,
>
> I am running R1.5.0 under unix.
>
> I recently used the function 'predict.tree' to make predictions with a
> tree object and a dataframe of numeric items. The predict.tree internally,
> calls a function 'delete.response'.
>
> When I removed this function call from the source code of predict.tree, it
> ran 10 times faster without any differences in the result obtained.
> The documentation for delete.response says that this function is used for
> deleting the response variable from the dataset. However the documentation
> for the predict.tree function says that the response variable is ignored
> during prediction.
>
> Could someone tell me why the function 'predict.tree' calls
> 'delete.response'?

To make prediction possible without having the response variable in
`newdata'.

Your description of `delete.response' is incorrect: see its help page.


-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list