Description Usage Arguments Details Value Author(s) Examples
This is a modification to the R function plot that adds confidence intervals to the plot.
1 2 3 4  | 
x, y | 
 The x and y coordinates of the points to plot.  | 
se | 
 Numeric vector the same length as   | 
level | 
 Significance level for the confidence interval. Default forms 95% interval.  | 
cval | 
 Critical value for the confidence interval. Default uses   | 
col | 
 Color for plotting the relationship between   | 
col.ci | 
 Color for plotting the confidence interval.  | 
alpha | 
 Transparency used for plotting confidence polygons. Only used when   | 
add | 
 Logical indicating whether lines should be added to current plot.  | 
type | 
 Type of plot to create (defaults to "l" for lines).  | 
link | 
 Link function to apply. See Details.  | 
axes | 
 Logical indicating if the axes should be drawn.  | 
bars | 
 Logical indicating if confidence bars should be plotted instead of polygons.  | 
barlty, barlwd | 
 Line type and width for confidence bars. Only used when   | 
bw | 
 Positive scalar giving the width of the confidence bars. Only used when   | 
... | 
 Additional arguments to be passed to   | 
The plotted confidence interval is c(link(y-cval*se), link(y+cval*se)) where link is the user-specified link function and cval is the user-sepcified critival value, which defaults to cval = qnorm(1-(1-level)/2).
Produces a plot with a colorbar.
Nathaniel E. Helwig <helwig@umn.edu>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16  | ##########   EXAMPLE   ##########
# define relatively smooth function
set.seed(773)
myfun <- function(x){ sin(2*pi*x) }
x <- runif(10^4)
y <- myfun(x) + rnorm(10^4)
# fit cubic smoothing spline
cubmod <- bigspline(x,y)
newdata <- data.frame(x=seq(0,1,length=20))
ypred <- predict(cubmod, newdata, se.fit=TRUE)
# plot predictions with CIs in two ways
plotci(newdata$x, ypred$fit, ypred$se.fit)
plotci(newdata$x, ypred$fit, ypred$se.fit, type="p", bars=TRUE, bw=0.02)
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.