Returns the coefficients from the model in a tibble
format.
# S3 method for class 'VAR'
tidy(x, ...)
An object to be converted into a tidy tibble::tibble()
.
Additional arguments to tidying method.
The model's coefficients in a tibble
.
lung_deaths <- cbind(mdeaths, fdeaths) %>%
as_tsibble(pivot_longer = FALSE)
lung_deaths %>%
model(VAR(vars(mdeaths, fdeaths) ~ AR(3))) %>%
tidy()
#> # A tibble: 14 × 7
#> .model term .response estimate std.error statistic p.value
#> <chr> <chr> <chr> <dbl> <dbl> <dbl> <dbl>
#> 1 VAR(vars(mdeaths, fdeat… lag(… mdeaths 0.667 0.355 1.88 6.48e-2
#> 2 VAR(vars(mdeaths, fdeat… lag(… mdeaths 0.807 0.835 0.967 3.37e-1
#> 3 VAR(vars(mdeaths, fdeat… lag(… mdeaths 0.368 0.352 1.04 3.01e-1
#> 4 VAR(vars(mdeaths, fdeat… lag(… mdeaths -1.45 0.809 -1.80 7.71e-2
#> 5 VAR(vars(mdeaths, fdeat… lag(… mdeaths 0.261 0.342 0.761 4.50e-1
#> 6 VAR(vars(mdeaths, fdeat… lag(… mdeaths -1.12 0.814 -1.38 1.73e-1
#> 7 VAR(vars(mdeaths, fdeat… cons… mdeaths 539. 137. 3.93 2.17e-4
#> 8 VAR(vars(mdeaths, fdeat… lag(… fdeaths 0.214 0.146 1.46 1.48e-1
#> 9 VAR(vars(mdeaths, fdeat… lag(… fdeaths 0.456 0.343 1.33 1.89e-1
#> 10 VAR(vars(mdeaths, fdeat… lag(… fdeaths 0.0937 0.145 0.646 5.20e-1
#> 11 VAR(vars(mdeaths, fdeat… lag(… fdeaths -0.398 0.333 -1.20 2.36e-1
#> 12 VAR(vars(mdeaths, fdeat… lag(… fdeaths 0.0250 0.141 0.178 8.60e-1
#> 13 VAR(vars(mdeaths, fdeat… lag(… fdeaths -0.315 0.335 -0.940 3.51e-1
#> 14 VAR(vars(mdeaths, fdeat… cons… fdeaths 202. 56.4 3.58 6.72e-4