[Rd] Last Call: Who says this is not a bug in delete.response()?

Paul Johnson pauljohn32 at gmail.com
Wed Jan 25 05:40:48 CET 2012

On January 5, I posted here concerning this issue
(https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=14767), and I
have not heard any answers from people who think this is not a bug,
or a simple accident in the delete.response function.

The output from delete.response on a terms object alters the formula
by removing the dependent variable. It removes the response from the
"variables" attribute and it changes the response attribute from 1 to
0.  The response is removed from "predvars"

But it leaves the name of the dependent variable first in the in
"dataClasses" attribute.  I believe delete.response should be fixed, and if
I'm wrong, I wish one of you would tell me.  Otherwise, I will ask Prof.
Ripley to re-open the bug report.

This is an important API question, since functions that use regression
models (in my opinion) ought to be able to count on delete.response
to leave behind a dataClasses attribute that no longer includes the response.

If we could count on that, then, some methods that work with fitted regressions
could work more easily. For example, the work in termplot
with variables "carrier" and "carrier.terms" would be unnecessary,
since the column names of
"dataClasses" would be, exactly, the carrier.name vector and the data
type information
of those variables would eliminate a lot of fancy footwork one has to
do in order
to calculate predicted values.

Paul E. Johnson
Professor, Political Science
1541 Lilac Lane, Room 504
University of Kansas

More information about the R-devel mailing list