regLine(mod, col=palette()[2], lwd=2, lty=1,...)
lm
,
that responds to the coef
function
by returning a 2-element vector, whose elements are
interpreted respectively as the
intercept and slope of a regresison line.2
(see par
).1
, a solid line (see par
).lines
plotting function.NULL
. This function is used for its side effect: adding
a line to the plot.abline
, this function plots only over
the range of the observed x-values. The x-values are extracted from
mod
as the second column of the model matrix.abline
, lines
plot(repwt ~ weight, pch=c(1,2)[sex], data=Davis)
regLine(lm(repwt~weight, subset=sex=="M", data=Davis))
regLine(lm(repwt~weight, subset=sex=="F", data=Davis), lty=2)
Run the code above in your browser using DataLab