linesHyberb.lm.RdAdd confidence/prediction hyperbolas for \(y(x_0)\) to a plot with data or regression line.
linesHyperb.lm(object, c.prob=0.95, confidence=FALSE,
k=if (confidence) Inf else 1,
col=2, lty=2, do.abline=TRUE)result of lm(.).
coverage probability in \((0,1)\).
logical; if true, do (small) confidence band, else,
realistic prediction band for the mean of k observations.
integer or Inf; assume k future observations;
k = Inf corresponds to confidence intervals (for y).
attributes for the lines to be drawn.
logical; if true, the regression line is drawn as well.
With predict.lm(*, interval=) is available,
this function linesHyperb.lm is only slightly more general for
its k argument.
predict.lm(*, interval=) optionally computes
prediction or confidence intervals.
data(swiss)
plot(Fertility ~ Education, data = swiss) # the data
(lmS <- lm(Fertility ~ Education, data = swiss))
#>
#> Call:
#> lm(formula = Fertility ~ Education, data = swiss)
#>
#> Coefficients:
#> (Intercept) Education
#> 79.6101 -0.8624
#>
linesHyperb.lm(lmS)
linesHyperb.lm(lmS, conf=TRUE, col="blue")