Skip to contents

Performs Hansen test

Usage

hansen_test(x, var, sigma = FALSE)

Arguments

x

lm object.

var

variables used for the joint test. By default all the variable are used.

sigma

logical indicating if the joint test should include the variance

Details

Perform Hansen test, which indicates if the variance of a model, a global model and the coefficients of the variable within this model are likely to be unstable over time.

HO: the coefficient/model is stable over time.

References

Bruce E Hansen "Testing for parameter instability in linear models". Journal of policy Modeling (1992)

Examples

model_gdp <- lm(
formula = growth_gdp ~ bc_fr_m1 + diff_bc_fr_m1,
data = gdp
)
hansen_test(model_gdp)
#>                    L Stat Reject at 5%
#> (Intercept)   0.2714 0.47        FALSE
#> bc_fr_m1      0.2827 0.47        FALSE
#> diff_bc_fr_m1 0.5113 0.47         TRUE
#> Variance      0.3836 0.47        FALSE
#> Joint Lc      1.5665 1.47         TRUE