# \donttest{
if (requireNamespace("strucchange", quietly = TRUE)) {
set.seed(123)
years <- 1980:2020
panel <- data.frame(
year = rep(years, 5),
sector = rep(LETTERS[1:5], each = length(years)),
log_direct = rnorm(length(years) * 5, 5, 0.5),
log_production = rnorm(length(years) * 5, 5, 0.5)
)
break_tests <- test_structural_breaks(panel)
print(break_tests$cusum)
}
# }
Run the code above in your browser using DataLab