chron.ci | R Documentation |
This function builds a mean value chronology with bootstrapped confidence
intervals, typically from a data.frame
of detrended ring widths as produced by
detrend
.
chron.ci(x, biweight=TRUE, conf=0.95, R=100)
x |
a |
biweight |
|
conf |
|
R |
|
This either averages the rows of the data.frame
using a mean or
a robust mean (the so-called standard chronology) and calculates boostrapped confidence intervals using the normal approximation. The function will fail if there are any rows in x
that contain only one sample and in practice there should be several samples in a row. One of the guiding principles of bootstrapping is that the population is to the sample as the sample is to the bootstrap samples.
An object of of class data.frame
with the standard chronology, the upper and lower confidence interval, and the sample depth. The years are stored as row numbers.
Andy Bunn.
read.rwl
, detrend
,
boot
, boot.ci
library(graphics)
library(utils)
data(wa082)
# truncate to a sample depth of five
wa082Trunc <- wa082[rowSums(!is.na(wa082))>4,]
# detrend
wa082RWI <- detrend(wa082Trunc, method="AgeDepSpline")
# bootstrap the chronology and
wa082Crn <- chron.ci(wa082RWI, biweight = TRUE, R = 100, conf = 0.99)
head(wa082Crn)
# plot (this is so much easier in ggplot!)
wa082Crn$yrs <- time(wa082Crn)
xx <- c(wa082Crn$yrs,rev(wa082Crn$yrs))
yy <- c(wa082Crn$lowerCI,rev(wa082Crn$upperCI))
plot(wa082Crn$yrs,wa082Crn$std,type="n",ylim=range(yy),
ylab="RWI",xlab="Year",main="Chronology with CI")
polygon(x=xx,y=yy,col = "grey",border = NA)
lines(wa082Crn$yrs,wa082Crn$std)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.