# plotci: Generic X-Y Plotting with Confidence Intervals In npreg: Nonparametric Regression via Smoothing Splines

## Description

Modification to the plot function that adds confidence intervals. The CIs can be plotted using polygons (default) or error bars.

## Usage

 1 2 3 4 plotci(x, y, se, level = 0.95, crit.val = NULL, add = FALSE, col = NULL, col.ci = NULL, alpha = NULL, bars = NULL, bw = 0.05, linkinv = NULL, ...)

## Arguments

 x a vector of 'x' values (n by 1). If y is missing, the x input can be a list or matrix containing the x, y, and se arguments. y a vector of 'y' values (n by 1). se a vector of standard error values (n by 1). level confidence level for the intervals (between 0 and 1). crit.val an optional critical value for the intervals. If provided, the level input is ignored. See Details. add a switch controlling whether a new plot should be created (via a call to plot) or if the plot should be added to the current plot (via a call to lines). col a character specifying the color for plotting the lines/points. col.ci a character specifying the color for plotting the intervals. alpha a scalar between 0 and 1 controlling the transparency of the intervals. bars a switch controlling whether the intervals should be plotted as bars or polygons. bw a positive scalar controlling the bar width. Ignored if bars = FALSE. linkinv an inverse link function for the plotting. If provided, the function plots x versus linkinv(y) and the intervals are similarly transformed. ... extra arguments passed to the plot or lines function.

## Details

This function plots x versus y with confidence intervals. The CIs have the form
lwr = y - crit.val * se
upr = y + crit.val * se
where crit.val is the critical value.

If crit.val = NULL, the critival value is determined from the level input as
crit.val <- qnorm(1-(1-level)/2)
where qnorm is the quantile function for the standard normal distribution.

## Author(s)

Nathaniel E. Helwig <helwig@umn.edu>