overall: Compute overall slope

Description Usage Arguments Value Details See Also Examples

View source: R/trim_overall.R

Description

The overal slope represents the total growth over the piecewise linear model.

Usage

1
2
3
4
5
6
overall(
  x,
  which = c("imputed", "fitted"),
  changepoints = numeric(0),
  bc = FALSE
)

Arguments

x

an object of class trim.

which

[character] Choose between "imputed" or "fitted" counts.

changepoints

[numeric] Change points for which to compute the overall slope, or "model", in which case the changepoints from the model are used (if any)

bc

[logical] Flag to set backwards compatability with TRIM with respect to trend interpretation. Defaults to FALSE.

Value

a list of class trim.overall containing, a.o., overall slope coefficients (slope), augmented with p-values and an interpretation).

Details

The overall slope represents the mean growth or decline over a period of time. This can be determined over the whole time period for which the model is fitted (this is the default) or may be computed over time slices that can be defined with the cp parameter. The values for changepoints do not depend on changepoints that were used when specifying the trim model (See also the example below).

Slopes are computed along with associated confidence intervals (CI) for 1% and 5% significance levels, and interpreted using the following table:

Trend meaning Condition
Strong increase (more than 5% per year) lower CI limit > 0.05
Moderate increase (less than 5% per year) lower CI limit > 0
Moderate decrease (less than 5% per year) upper CI limit < 0
Strong decrease (more than 5% per year) upper CI limit < -0.05
Stable -0.05 < lower < 0 < upper < 0.05
Uncertain any other case

where trend strength takes precedence over significance, i.e., a strong increase (p<0.05) takes precedence over a moderate increase (p<0.01).

Note that the original TRIM erroneously assumed that the estimated overall trend magnitude is t-distributed, while in fact it is normally distributed, which is being used within rtrim. The option bc=TRUE can be set to force backward compability, for e.g. comparison purposes.

See Also

Other analyses: coef.trim(), confint.trim(), gof(), index(), now_what(), overdispersion(), plot.trim.index(), plot.trim.overall(), results(), serial_correlation(), summary.trim(), totals(), trim(), vcov.trim(), wald()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# obtain the overall slope accross all change points.
data(skylark)
z <- trim(count ~ site + time, data=skylark, model=2)
overall(z)
plot(overall(z))

# Overall is a list, you can get information out if it using the $ syntax,
# for example
L <- overall(z)
L$slope

# Obtain the slope from changepoint to changepoint
z <- trim(count ~ site + time, data=skylark, model=2,changepoints=c(1,4,6))
# slope from time point 1 to 5
overall(z,changepoints=c(1,5,7))

rtrim documentation built on April 21, 2020, 5:06 p.m.