addCI | R Documentation |
Adds confidence interval lines to a simple linear regression or q-normal graph.
addCI(type, level = 0.95, Plot = list(name = "", what = "lines", type = "solid", width = "standard", color = "black"), current = list(yaxis.log = FALSE, yaxis.rev = FALSE, xaxis.log = FALSE))
type |
the type of confidence interval desired. Must be either "SLR" for the confidence
interval for a simple linear regression model, which must have been created using the
|
level |
the confidence level desired. |
Plot |
parameters defining the characteristics of the plot. See
|
current |
the current plot information, normally the output from a high-level
graphics function like |
The current plot information, the x and y components are the data, not the line. The regression model is included as the lm component.
The equation for the confidence intervals for a simple linear regression
model can be found in any textbook on regression, see section 9.4.4 in Helsel and
Hirsch (2002) for example.
The confidence interval for a normal distribution is described in Appendix 9 in
U.S. Water Resources Council (1982). Owen (1968) describes the application of the
noncentral t-distribution for computing the tolerance limits for a normal
distribition.
Helsel, D.R., and Hirsch, R.M., 2002, Statistical methods in water resources:
U.S. Geological Survey Techniques of Water-Resources Investigations, book 4,
chap. A3, 522 p.
U.S. Water Resources Council, 1982, Guidelines for determining flood flow frequency,
revised September 1981, Editorial Corrections March 1982:
Hydrology Committee Bulletin 17B, Washington D.C., 190 p., 1 plate.
addSLR
, qqPlot
, addErrorBars
## Not run: set.seed(1) X <- rnorm(32) setGD() AA.pl <- qqPlot(X) addCI("q-norm", current=AA.pl) # For more details of addCI see vignette(topic="GraphAdditions", package="smwrGraphs") ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.