| trendlines {rtrim} | R Documentation |
Extract 'overall' trendlines
Description
Extract 'overall' trendlines
Usage
trendlines(x)
Arguments
x |
An object of class |
Value
A data.frame containing the information on all trendline segments and their uncertainty. The data.frame has the following columns:
segmentsegment ID, starting at 1
yearyear for which value, lo and hi are given
valuethe y coordinate of the trendline segment
lolower value of the uncertainty band
hiupper value of the uncertainty interval
See Also
Other analyses:
coef.trim(),
confint.trim(),
gof(),
index(),
now_what(),
overall(),
overdispersion(),
plot.trim.index(),
plot.trim.overall(),
plot.trim.smooth(),
results(),
serial_correlation(),
summary.trim(),
totals(),
trim(),
vcov.trim(),
wald()
Examples
data(skylark2)
z <- trim(count ~ site+year, data=skylark2, model=3)
tt <- totals(z, long=TRUE) # collect time-totals
tl <- trendlines(overall(z)) # collect overall trend line
# define plot limits
xr <- range(tt$year)
yr <- range(tl$lo, tl$hi, tt$value)
plot(xr, yr, type='n', xlab="Year", ylab="Total counts")
# Plot uncertainty band
ubx <- c(tl$year, rev(tl$year))
uby <- c(tl$lo, rev(tl$hi))
polygon(ubx, uby, col=gray(0.9), border=NA)
# Plot trend line
lines(tl$year, tl$value, col="black", lwd=2)
# Plot time-totals
lines(tt$year, tt$value, col="red", lwd=2)
points(tt$year, tt$value, col="red", pch=16, cex=1.5)
[Package rtrim version 2.3.0 Index]