From john.maindonald at anu.edu.au  Sat Jan 24 03:23:47 2004
From: john.maindonald at anu.edu.au (John Maindonald)
Date: Sat Jan 24 03:24:17 2004
Subject: [Rd] Enhancement to termplot()
Message-ID: <574B2D4C-4E14-11D8-A1E7-000A95CDA0F2@anu.edu.au>

I'd like to make the following change to termplot():

Add panel=points as an extra parameter.

Replace
        if (partial.resid)
             points(xx, pres[, i], cex = cex, pch = pch, col = col.res, 
...)
by
        if (partial.resid)
             panel(xx, pres[, i], cex = cex, pch = pch, col = col.res, 
...)

Also, I think, add col.smooth, span and iter as named parameters; see 
below.

This allows, e.g., the following

par(mfcol=c(2, 2))
data(mtcars)
cars.lm <- lm(mpg~disp+hp, data=mtcars)
termplot(cars.lm, partial.resid=T, panel=panel.smooth, 
col.smooth="blue")
termplot(cars.lm, partial.resid=T, panel=panel.smooth, col.terms=0,
                 col.smooth="blue")

(col.terms=0 hides the fitted response line or curve.)
These partial regression plots can be highly insightful in a regression
context.

Inclusion of col.smooth, span and iter as named parameters is not
strictly necessary, but it does avert complaints from plot() when they
are passed as unnamed parameters.

(I foreshadowed this when I submitted problem #6327, and offered a fix
that, in default of anything better, I assume will be made or has been 
made.)

John Maindonald             email: john.maindonald@anu.edu.au
phone : +61 2 (6125)3473    fax  : +61 2(6125)5549
Centre for Bioinformation Science, Room 1194,
John Dedman Mathematical Sciences Building (Building 27)
Australian National University, Canberra ACT 0200.


[Rd] Enhancement to termplot()
John Maindonald