SNStatComp/rtrim

plot.trim.overall() doesn't plot 95% CI but standard errors of the time totals

telenskyt opened this issue · 1 comments

The plot.trim.overall() function description in the help is:

Creates a plot of the overall slope, its 95% confidence band, the total population per time and their 95% confidence intervals.

However, the function doesn't plot 95% CI, but, rather, standard errors - similar ones to be plotted with plot(totals(m), band = "se"), which are advertised as standard errors:

library(rtrim)
data(skylark)
m <- trim(count ~ site + time, data=skylark, model=2)
par(mfrow=c(1,2))
plot(overall(m)) # advertises to plot 95% CI of the time totals
plot(totals(m), band = "se") # but this one plots an error band, advertised as "se", of perhaps the same width

image

And indeed, the code of plot.trim.overall() does suggest so:

# error bars
y0 = ydata - X$err
y1 = ydata + X$err
...
segments(tpt,y0, tpt,y1, lwd=3, col=gray(0.5))

Tested on rtrim package version 2.1.1.

Fixed the documentation in the new version 2.3.0 (published today). Thanks for pointing this out.

Maybe in a future version the CI could be output as well.