Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

linesHyberb.lm

Plot Confidence or Prediction Hyperbolas around a Regression Line


Description

Add confidence/prediction hyperbolas for y(x_0) to a plot with data or regression line.

Usage

linesHyperb.lm(object, c.prob=0.95, confidence=FALSE,
            k=if (confidence) Inf else 1,
            col=2, lty=2, do.abline=TRUE)

Arguments

object

result of lm(.).

c.prob

coverage probability in (0,1).

confidence

logical; if true, do (small) confidence band, else, realistic prediction band for the mean of k observations.

k

integer or Inf; assume k future observations; k = Inf corresponds to confidence intervals (for y).

col, lty

attributes for the lines to be drawn.

do.abline

logical; if true, the regression line is drawn as well.

Note

With predict.lm(*, interval=) is available, this function linesHyperb.lm is only slightly more general for its k argument.

Author(s)

Martin Maechler, Oct 1995

See Also

predict.lm(*, interval=) optionally computes prediction or confidence intervals.

Examples

data(swiss)
      plot(Fertility ~ Education, data = swiss) # the data
(lmS <- lm(Fertility ~ Education, data = swiss))
linesHyperb.lm(lmS)
linesHyperb.lm(lmS, conf=TRUE, col="blue")

sfsmisc

Utilities from 'Seminar fuer Statistik' ETH Zurich

v1.1-11
GPL (>= 2)
Authors
Martin Maechler [aut, cre] (<https://orcid.org/0000-0002-8685-9910>), Werner Stahel [ctb] (Functions: compresid2way(), f.robftest(), last(), p.scales(), p.dnorm()), Andreas Ruckstuhl [ctb] (Functions: p.arrows(), p.profileTraces(), p.res.2x()), Christian Keller [ctb] (Functions: histBxp(), p.tachoPlot()), Kjetil Halvorsen [ctb] (Functions: KSd(), ecdf.ksCI()), Alain Hauser [ctb] (Functions: cairoSwd(), is.whole(), toLatex.numeric()*), Christoph Buser [ctb] (to function Duplicated()), Lorenz Gygax [ctb] (to function p.res.2fact()), Bill Venables [ctb] (Functions: empty.dimnames(), primes()), Tony Plate [ctb] (to inv.seq()), Isabelle Fl<fc>ckiger [ctb], Marcel Wolbers [ctb], Markus Keller [ctb], Sandrine Dudoit [ctb], Jane Fridlyand [ctb], Greg Snow [ctb] (to loessDemo()), Henrik Aa. Nielsen [ctb] (to loessDemo()), Vincent Carey [ctb], Ben Bolker [ctb], Philippe Grosjean [ctb], Fr<e9>d<e9>ric Ibanez [ctb], Caterina Savi [ctb], Charles Geyer [ctb], Jens Oehlschl<e4>gel [ctb]
Initial release
2021-04-03

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.