| detect_shocks | R Documentation |
Evaluates admissible split points using the proportional reduction in residual sum of squares from separate linear trends. This is a screening diagnostic and not a causal identification procedure.
detect_shocks(data, time, outcome, min_segment = 5L,
direction = c("any", "down", "up"))
data |
A data frame. |
time |
Character string naming the ordered time column. |
outcome |
Character string naming the numeric outcome column. |
min_segment |
Minimum observations on each side of a candidate split. |
direction |
Whether to retain any, downward, or upward shifts. |
A data frame of candidate times, scores, and estimated level shifts, sorted from strongest to weakest.
dat <- subset(erri_example_data(), region == "North")
head(detect_shocks(dat, "year", "income"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.