Skip to content
Prev 42187 / 63424 Next

delete.response leaves response in attribute dataClasses

Thanks, Bill

Counter-arguments at the end
On Thu, Jan 5, 2012 at 3:15 PM, William Dunlap <wdunlap at tibco.com> wrote:
I can't understand what your point is.  I agree we can work around the
problem, but why should we have to?

If you confine yourself to the output of "delete.response" applied to
a terms object from a regression, can you point to any package or
usage that depends on leaving the response variable in the dataClasses
attribute?  I can't find one.  In R base, these are all the references
to delete.response:

stats/R/models.R:delete.response <- function (termobj)
stats/R/lm.R:        Terms <- delete.response(tt)
stats/R/lm.R:        Terms <- delete.response(tt)
stats/R/ppr.R:        Terms <- delete.response(object$terms)
stats/R/loess.R:
as.matrix(model.frame(delete.response(terms(object)), newdata,
stats/R/dummy.coef.R:    Terms <- delete.response(Terms)

I've looked it over carefully and predict.lm (in lm.R) would not be
affected by the change I propose. I can't find any usage in loess.R of
the dataClasses attribute.

Furthermore, I can't see how a person would use the dataClasses
attribute at all, after the other markers of the response are
eliminated. How is a method to find which variable is the response,
after response=0?

I'm not disagreeing with you that I can workaround the peculiarity
that the response is left in the dataClasses attribute of the output
object from delete.response.  I'm just saying it is a complication
that programmers should not have to put up with, because I think
delete.response should delete the response from all attributes of a
terms object.

pj