R/quadline.R

"quadline" <-
function (lm.obj, ...) 
{
x.range <- range(model.matrix(lm.obj)[,2])
x.df <- data.frame(seq(x.range[1],x.range[2],length=101))
names(x.df)<-names(coefficients(lm.obj))[2]
y.hat <- predict(lm.obj, newdata = x.df)
z <- spline(x.df[,1],y.hat)
lines(z$x, z$y, ...)
invisible()
}

Try the MPV package in your browser

Any scripts or data that you put into this service are public.

MPV documentation built on Sept. 8, 2023, 5:44 p.m.