Title: | Panel Vector Autoregression |
---|---|
Description: | We extend two general methods of moment estimators to panel vector autoregression models (PVAR) with p lags of endogenous variables, predetermined and strictly exogenous variables. This general PVAR model contains the first difference GMM estimator by Holtz-Eakin et al. (1988) <doi:10.2307/1913103>, Arellano and Bond (1991) <doi:10.2307/2297968> and the system GMM estimator by Blundell and Bond (1998) <doi:10.1016/S0304-4076(98)00009-8>. We also provide specification tests (Hansen overidentification test, lag selection criterion and stability test of the PVAR polynomial) and classical structural analysis for PVAR models such as orthogonal and generalized impulse response functions, bootstrapped confidence intervals for impulse response analysis and forecast error variance decompositions. |
Authors: | Michael Sigmund [aut], Robert Ferstl [aut, cre] |
Maintainer: | Robert Ferstl <[email protected]> |
License: | GPL (>= 2) |
Version: | 0.5.5 |
Built: | 2024-11-20 04:05:36 UTC |
Source: | https://github.com/cran/panelvar |
This data set contains labor demand data from a panel of firms in the United Kingdom. The panel is unlanced.
abdata
abdata
The variables are:
Record ID
Firm index
Year
Employment
Wage
Capital
Industrial output
Logs of variables
Record number
Lagged year
ID
Lags of log variables
Time dummies
https://www.stata-press.com/data/r13/abdata.dta
Arellano, M. and Bond, S. (1991) "Some tests of specification for panel data: Monte Carlo evidence and an application to employment equations", The Review of Economic Studies, 58(2), 227-297, doi:10.2307/2297968
...
Andrews_Lu_MMSC(model, HQ_criterion = 2.1) ## S3 method for class 'pvargmm' Andrews_Lu_MMSC(model, HQ_criterion = 2.1)
Andrews_Lu_MMSC(model, HQ_criterion = 2.1) ## S3 method for class 'pvargmm' Andrews_Lu_MMSC(model, HQ_criterion = 2.1)
model |
A PVAR model |
HQ_criterion |
Hannan Quinn criterion |
BIC, AIC and HQIC
Andrews, D., Lu, B. (2001) Consistent Model and Momement Selection Procedures for GMM Estimation with Application to Dynamic Panel Data Models, Journal of Econometrics, 101(1), 123–164, doi:10.1016/S0304-4076(00)00077-4
data("ex3_abdata") Andrews_Lu_MMSC(ex3_abdata)
data("ex3_abdata") Andrews_Lu_MMSC(ex3_abdata)
Uses blockwise sampling of individuals (bootstrapping).
bootstrap_irf( model, typeof_irf, n.ahead, nof_Nstar_draws, confidence.band, mc.cores ) ## S3 method for class 'pvargmm' bootstrap_irf( model, typeof_irf = c("OIRF", "GIRF"), n.ahead, nof_Nstar_draws, confidence.band = 0.95, mc.cores = getOption("mc.cores", 2L) ) ## S3 method for class 'pvarfeols' bootstrap_irf( model, typeof_irf = c("OIRF", "GIRF"), n.ahead, nof_Nstar_draws, confidence.band = 0.95, mc.cores = getOption("mc.cores", 2L) )
bootstrap_irf( model, typeof_irf, n.ahead, nof_Nstar_draws, confidence.band, mc.cores ) ## S3 method for class 'pvargmm' bootstrap_irf( model, typeof_irf = c("OIRF", "GIRF"), n.ahead, nof_Nstar_draws, confidence.band = 0.95, mc.cores = getOption("mc.cores", 2L) ) ## S3 method for class 'pvarfeols' bootstrap_irf( model, typeof_irf = c("OIRF", "GIRF"), n.ahead, nof_Nstar_draws, confidence.band = 0.95, mc.cores = getOption("mc.cores", 2L) )
model |
A PVAR model |
typeof_irf |
|
n.ahead |
n ahead steps |
nof_Nstar_draws |
Number of draws |
confidence.band |
Confidence band |
mc.cores |
Number of cores to use |
## Not run: data("ex1_dahlberg_data") ex1_dahlberg_data_bs <- bootstrap_irf(ex1_dahlberg_data, typeof_irf = c("GIRF"), n.ahead = 8, nof_Nstar_draws = 500, confidence.band = 0.95, mc.cores = 100) ## End(Not run) data("ex1_dahlberg_data") ex1_dahlberg_data_girf <- girf(ex1_dahlberg_data, n.ahead = 8, ma_approx_steps= 8) data("ex1_dahlberg_data_bs") plot(ex1_dahlberg_data_girf, ex1_dahlberg_data_bs)
## Not run: data("ex1_dahlberg_data") ex1_dahlberg_data_bs <- bootstrap_irf(ex1_dahlberg_data, typeof_irf = c("GIRF"), n.ahead = 8, nof_Nstar_draws = 500, confidence.band = 0.95, mc.cores = 100) ## End(Not run) data("ex1_dahlberg_data") ex1_dahlberg_data_girf <- girf(ex1_dahlberg_data, n.ahead = 8, ma_approx_steps= 8) data("ex1_dahlberg_data_bs") plot(ex1_dahlberg_data_girf, ex1_dahlberg_data_bs)
This panel data set consists of 46 U.S. States over the period 1963-1992.
Cigar
Cigar
The variables are:
State abbreviation
Year
Price per pack of cigarettes
Population
Population above the age of 16.
Consumer price index with (1983=100
Per capita disposable income
Cigarette sales in packs per capita
Minimum price in adjoining states per pack of cigarettes
All variables all also available as logs.
https://www.wiley.com/legacy/wileychi/baltagi/supp/Cigar.txt
Baltagi, B.H. and D. Levin (1992) "Cigarette taxation: raising revenues and reducing consumption", Structural Change and Economic Dynamics, 3(2), 321-335, doi:10.1016/0954-349X(92)90010-4.
Baltagi, B.H., J.M. Griffin and W. Xiong (2000) "To pool or not to pool: homogeneous versus heterogeneous estimators applied to cigarette demand", Review of Economics and Statistics, 82(1), 117-126, doi:10.1162/003465300558551.
Baltagi, B.H. (2013) "Econometric analysis of panel data", 5th edition, John Wiley and Sons Cigar
Extract PVARFEOLS(p) Model Coefficients
## S3 method for class 'pvarfeols' coef(object, ...)
## S3 method for class 'pvarfeols' coef(object, ...)
object |
object |
... |
further arguments |
Extract PVAR(p) Model Coefficients
## S3 method for class 'pvargmm' coef(object, ...)
## S3 method for class 'pvargmm' coef(object, ...)
object |
object |
... |
further arguments |
data("ex1_dahlberg_data") coef(ex1_dahlberg_data)
data("ex1_dahlberg_data") coef(ex1_dahlberg_data)
Extract PVARHK(p) Model Coefficients
## S3 method for class 'pvarhk' coef(object, ...)
## S3 method for class 'pvarhk' coef(object, ...)
object |
object |
... |
further arguments |
The panel data set consists of 265 Swedish municipalities and covers 9 years (1979-1987).
Dahlberg
Dahlberg
The variables are:
ID number for municipality
Year
Total expenditures
Total own-source revenues
Intergovernmental grants received by the municipality
Total expenditures contains both capital and current expenditures.
Expenditures, revenues, and grants are expressed in million SEK. The series are deflated and in per capita form. The implicit deflator is a municipality-specific price index obtained by dividing total local consumption expenditures at current prices by total local consumption expenditures at fixed (1985) prices.
The data are gathered by Statistics Sweden and obtained from Financial Accounts for the Municipalities (Kommunernas Finanser).
http://qed.econ.queensu.ca/jae/2000-v15.4/dahlberg-johansson/
M. Dahlberg and E. Johansson (2000) "An examination of the dynamic behavior of local governments using GMM bootstrapping methods", Journal of Applied Econometrics, 15(4), 401-416, https://www.jstor.org/stable/2678589.
Dahlberg results example 1
ex1_dahlberg_data
ex1_dahlberg_data
An object of class pvargmm
of length 35.
Dahlberg bootstrap results example 1
ex1_dahlberg_data_bs
ex1_dahlberg_data_bs
An object of class list
of length 4.
NLS Work 2 bootstrap results example 2
ex2_nlswork2_data_bs
ex2_nlswork2_data_bs
An object of class list
of length 4.
Example results for Employment UK data
ex3_abdata
ex3_abdata
An object of class pvargmm
of length 36.
Extract Coefficients and GOF Measures from a Statistical Object
extract(model, ...) ## S3 method for class 'pvargmm' extract(model, ...) ## S3 method for class 'pvarfeols' extract(model, ...) ## S3 method for class 'pvarhk' extract(model, ...)
extract(model, ...) ## S3 method for class 'pvargmm' extract(model, ...) ## S3 method for class 'pvarfeols' extract(model, ...) ## S3 method for class 'pvarhk' extract(model, ...)
model |
Model |
... |
Further arguments passed to or from other methods |
data("ex1_dahlberg_data") extract(ex1_dahlberg_data)
data("ex1_dahlberg_data") extract(ex1_dahlberg_data)
Computes the forecast error variance decomposition of a PVAR(p) model.
fevd_orthogonal(model, n.ahead = 10) ## S3 method for class 'pvargmm' fevd_orthogonal(model, n.ahead = 10) ## S3 method for class 'pvarfeols' fevd_orthogonal(model, n.ahead = 10)
fevd_orthogonal(model, n.ahead = 10) ## S3 method for class 'pvargmm' fevd_orthogonal(model, n.ahead = 10) ## S3 method for class 'pvarfeols' fevd_orthogonal(model, n.ahead = 10)
model |
A PVAR model |
n.ahead |
Number of steps |
The estimation is based on orthogonalised impulse response functions.
A list with forecast error variances as matrices for each variable.
A plot
method will be provided in future versions.
Pfaff, B. (2008) VAR, SVAR and SVEC Models: Implementation Within R Package vars, Journal of Statistical Software 27(4) https://www.jstatsoft.org/v27/i04/
pvargmm
for model estimaion
oirf
for orthogonal impulse response function
data("ex1_dahlberg_data") fevd_orthogonal(ex1_dahlberg_data, n.ahead = 8)
data("ex1_dahlberg_data") fevd_orthogonal(ex1_dahlberg_data, n.ahead = 8)
Extracting Fixed Effects
fixedeffects(model, ...) ## S3 method for class 'pvargmm' fixedeffects(model, Only_Non_NA_rows = TRUE, ...)
fixedeffects(model, ...) ## S3 method for class 'pvargmm' fixedeffects(model, Only_Non_NA_rows = TRUE, ...)
model |
Model |
... |
Further arguments passed to or from other methods |
Only_Non_NA_rows |
Filter NA rows |
data("ex1_dahlberg_data") fixedeffects(ex1_dahlberg_data)
data("ex1_dahlberg_data") fixedeffects(ex1_dahlberg_data)
Generalized Impulse Response Function
girf(model, n.ahead, ma_approx_steps) ## S3 method for class 'pvargmm' girf(model, n.ahead, ma_approx_steps)
girf(model, n.ahead, ma_approx_steps) ## S3 method for class 'pvargmm' girf(model, n.ahead, ma_approx_steps)
model |
A PVAR model |
n.ahead |
Any stable AR() model has an infinite MA representation. Hence any shock can be simulated infinitely into the future. For each forecast step t you need an additional MA term. |
ma_approx_steps |
MA approximation steps |
data("ex1_dahlberg_data") girf(ex1_dahlberg_data, n.ahead = 8, ma_approx_steps= 8)
data("ex1_dahlberg_data") girf(ex1_dahlberg_data, n.ahead = 8, ma_approx_steps= 8)
Sargan-Hansen-J-Test for Overidentification
hansen_j_test(model, ...) ## S3 method for class 'pvargmm' hansen_j_test(model, ...)
hansen_j_test(model, ...) ## S3 method for class 'pvargmm' hansen_j_test(model, ...)
model |
A PVAR model |
... |
Further arguments passed to or from other methods |
data("ex1_dahlberg_data") hansen_j_test(ex1_dahlberg_data)
data("ex1_dahlberg_data") hansen_j_test(ex1_dahlberg_data)
Knit Print Method for pvarfeols
## S3 method for class 'pvarfeols' knit_print(x, ...)
## S3 method for class 'pvarfeols' knit_print(x, ...)
x |
object |
... |
further arguments |
Knit Print Method for pvargmm
## S3 method for class 'pvargmm' knit_print(x, ...)
## S3 method for class 'pvargmm' knit_print(x, ...)
x |
object |
... |
further arguments |
Knit Print Method for pvarhk
## S3 method for class 'pvarhk' knit_print(x, ...)
## S3 method for class 'pvarhk' knit_print(x, ...)
x |
object |
... |
further arguments |
Knit Print summary Method
## S3 method for class 'summary.pvarfeols' knit_print(x, ...)
## S3 method for class 'summary.pvarfeols' knit_print(x, ...)
x |
object |
... |
further arguments |
Knit Print summary Method
## S3 method for class 'summary.pvargmm' knit_print(x, ...)
## S3 method for class 'summary.pvargmm' knit_print(x, ...)
x |
object |
... |
further arguments |
Knit Print summary Method
## S3 method for class 'summary.pvarhk' knit_print(x, ...)
## S3 method for class 'summary.pvarhk' knit_print(x, ...)
x |
object |
... |
further arguments |
NLS Work 2 data
nlswork2
nlswork2
An object of class data.frame
with 16094 rows and 21 columns.
Orthogonal Impulse Response Function
oirf(model, n.ahead)
oirf(model, n.ahead)
model |
A PVAR model |
n.ahead |
Any stable AR() model has an infinite MA representation. Hence any shock can be simulated infinitely into the future. For each forecast step t you need an addtional MA term. |
data("ex1_dahlberg_data") oirf(ex1_dahlberg_data, n.ahead = 8)
data("ex1_dahlberg_data") oirf(ex1_dahlberg_data, n.ahead = 8)
ggplot
objectS3 plot method for pvarstability object, returns a ggplot
object
## S3 method for class 'pvarstability' plot(x, ...)
## S3 method for class 'pvarstability' plot(x, ...)
x |
object |
... |
further arguments |
S3 Print Method for pvarfeols
## S3 method for class 'pvarfeols' print(x, ...)
## S3 method for class 'pvarfeols' print(x, ...)
x |
object |
... |
further arguments |
S3 Print Method for pvargamm
## S3 method for class 'pvargmm' print(x, ...)
## S3 method for class 'pvargmm' print(x, ...)
x |
object |
... |
further arguments |
S3 Print Method for pvarhk
## S3 method for class 'pvarhk' print(x, ...)
## S3 method for class 'pvarhk' print(x, ...)
x |
object |
... |
further arguments |
S3 print method for pvarstability object
## S3 method for class 'pvarstability' print(x, ...)
## S3 method for class 'pvarstability' print(x, ...)
x |
object |
... |
further arguments |
S3 Print Method for summary.pvarfeols
## S3 method for class 'summary.pvarfeols' print(x, ...)
## S3 method for class 'summary.pvarfeols' print(x, ...)
x |
object |
... |
further arguments |
S3 Print Method for summary.pvargmm
## S3 method for class 'summary.pvargmm' print(x, ...)
## S3 method for class 'summary.pvargmm' print(x, ...)
x |
object |
... |
further arguments |
S3 Print Method for summary.pvarhk
## S3 method for class 'summary.pvarhk' print(x, ...)
## S3 method for class 'summary.pvarhk' print(x, ...)
x |
object |
... |
further arguments |
P-value S3 Method
pvalue(object, ...) ## S3 method for class 'pvargmm' pvalue(object, ...) ## S3 method for class 'pvarfeols' pvalue(object, ...) ## S3 method for class 'pvarhk' pvalue(object, ...)
pvalue(object, ...) ## S3 method for class 'pvargmm' pvalue(object, ...) ## S3 method for class 'pvarfeols' pvalue(object, ...) ## S3 method for class 'pvarhk' pvalue(object, ...)
object |
Object |
... |
Further arguments |
data("ex1_dahlberg_data") pvalue(ex1_dahlberg_data)
data("ex1_dahlberg_data") pvalue(ex1_dahlberg_data)
This function estimates a stationary PVAR with fixed effects.
pvarfeols( dependent_vars, lags, exog_vars, transformation = c("demean"), data, panel_identifier = c(1, 2) )
pvarfeols( dependent_vars, lags, exog_vars, transformation = c("demean"), data, panel_identifier = c(1, 2) )
dependent_vars |
Dependent variables |
lags |
Number of lags of dependent variables |
exog_vars |
Exogenous variables |
transformation |
Demeaning |
data |
Data set |
panel_identifier |
Vector of panel identifiers |
data(Cigar) ex1_feols <- pvarfeols(dependent_vars = c("log_sales", "log_price"), lags = 1, exog_vars = c("cpi"), transformation = "demean", data = Cigar, panel_identifier= c("state", "year")) summary(ex1_feols)
data(Cigar) ex1_feols <- pvarfeols(dependent_vars = c("log_sales", "log_price"), lags = 1, exog_vars = c("cpi"), transformation = "demean", data = Cigar, panel_identifier= c("state", "year")) summary(ex1_feols)
Estimates a panel vector autoregressive (PVAR) model with fixed effects.
pvargmm( dependent_vars, lags, predet_vars, exog_vars, transformation = "fd", data, panel_identifier = c(1, 2), steps, system_instruments = FALSE, system_constant = TRUE, pca_instruments = FALSE, pca_eigenvalue = 1, max_instr_dependent_vars, max_instr_predet_vars, min_instr_dependent_vars = 2L, min_instr_predet_vars = 1L, collapse = FALSE, tol = 1e-09, progressbar = TRUE )
pvargmm( dependent_vars, lags, predet_vars, exog_vars, transformation = "fd", data, panel_identifier = c(1, 2), steps, system_instruments = FALSE, system_constant = TRUE, pca_instruments = FALSE, pca_eigenvalue = 1, max_instr_dependent_vars, max_instr_predet_vars, min_instr_dependent_vars = 2L, min_instr_predet_vars = 1L, collapse = FALSE, tol = 1e-09, progressbar = TRUE )
dependent_vars |
Dependent variables |
lags |
Number of lags of dependent variables |
predet_vars |
Predetermined variables |
exog_vars |
Exogenous variables |
transformation |
First-difference |
data |
Data set |
panel_identifier |
Vector of panel identifiers |
steps |
|
system_instruments |
System GMM estimator |
system_constant |
Constant only available with the System GMM estimator in each equation |
pca_instruments |
Apply PCA to instruments matrix |
pca_eigenvalue |
Cut-off eigenvalue for PCA analysis |
max_instr_dependent_vars |
Maximum number of instruments for dependent variables |
max_instr_predet_vars |
Maximum number of instruments for predetermined variables |
min_instr_dependent_vars |
Minimum number of instruments for dependent variables |
min_instr_predet_vars |
Minimum number of instruments for predetermined variables |
collapse |
Use collapse option |
tol |
relative tolerance to detect zero singular values in |
progressbar |
show progress bar |
The first vector autoregressive panel model (PVAR) was introduced by Holtz-Eakin et al. (1988). Binder et al. (2005) extend their equation-by-equation estimator for a PVAR model with only endogenous variables that are lagged by one period. We further improve this model in Sigmund and Ferstl (2021) to allow for lags of
endogenous variables,
predetermined variables and
strictly exogenous variables.
Therefore, we consider the following stationary PVAR with fixed effects.
yi,t = μi + ∑l=1pAlyi,t-l + Bxi,t + Csi,t + εi,t Let yi,t ∈ ℜm be an m×1 vector of endogenous variables for the ith cross-sectional unit at time t. Let yi,t-l ∈ ℜm be an m×1 vector of lagged endogenous variables. Let xi,t ∈ ℜk be an k×1 vector of predetermined variables that are potentially correlated with past errors. Let si,t ∈ ℜn be an n×1 vector of strictly exogenous variables that neither depend on εi,t nor on εi,t-s for s = 1,…,T. The idiosyncratic error vector εi,t ∈ ℜm is assumed to be well-behaved and independent from both the regressors xi,t and si,t and the individual error component μi. Stationarity requires that all unit roots of the PVAR model fall inside the unit circle, which therefore places some constraints on the fixed effect μi. The cross section i and the time section t are defined as follows: i = 1,…,N and t = 1,…T. In this specification we assume parameter homogeneity for Al(m×m), B (m×k) and C (m×n) for all i.A PVAR model is hence a combination of a single equation dynamic panel model (DPM) and a vector autoregressive model (VAR).
First difference and system GMM estimators for single equation dynamic panel data models have been implemented in the STATA package xtabond2
by Roodman (2009) and some of the features are also available in the R package plm.
For more technical details on the estimation, please refer to our paper Sigmund and Ferstl (2021).
There we define the first difference moment conditions (see Holtz-Eakin et al., 1988; Arellano and Bond, 1991), formalize the ideas to reduce the number of moment conditions by linear transformations of the instrument matrix and define the one- and two-step GMM estimator. Furthermore, we setup the system moment conditions as defined in Blundell and Bond (1998) and present the extended GMM estimator. In addition to the GMM-estimators we contribute to the literature by providing specification tests (Hansen overidentification test, lag selection criterion and stability test of the PVAR polynomial) and classical structural analysis for PVAR models such as orthogonal and generalized impulse response functions, bootstrapped confidence intervals for impulse response analysis and forecast error variance decompositions. Finally, we implement the first difference and the forward orthogonal transformation to remove the fixed effects.
A pvargmm
object containing the estimation results.
Arellano, M., Bond, S. (1991) Some Tests of Specification for Panel Sata: Monte Carlo Evidence and an Application to Employment Equations The Review of Economic Studies, 58(2), 277–297, doi:10.2307/2297968
Binder M., Hsiao C., Pesaran M.H. (2005) Estimation and Inference in Short Panel Vector Autoregressions with Unit Roots and Cointegration Econometric Theory, 21(4), 795–837, doi:10.1017/S0266466605050413
Blundell R., Bond S. (1998). Initial Conditions and Moment Restrictions in Dynamic Panel Data Models Journal of Econometrics, 87(1), 115–143, doi:10.1016/S0304-4076(98)00009-8
Holtz-Eakin D., Newey W., Rosen H.S. (1988) Estimating Vector Autoregressions with Panel Data, Econometrica, 56(6), 1371–1395, doi:10.2307/1913103
Roodman, D. (2009) How to Do xtabond2: An Introduction to Difference and System GMM in Stata The Stata Journal, 9(1), 86–136, https://www.stata-journal.com/article.html?article=st0159
Sigmund, M., Ferstl, R. (2021) Panel Vector Autoregression in R with the Package panelvar The Quarterly Review of Economics and Finance doi:10.1016/j.qref.2019.01.001
stability
for stability tests
oirf
and girf
for orthogonal and generalized impulse response functions (including bootstrapped confidence intervals)
coef.pvargmm
, se
, pvalue
, fixedeffects
for extrator functions for the most important results
fevd_orthogonal
for forecast error variance decomposition
## Not run: library(panelvar) data(abdata) ex3_abdata <-pvargmm( dependent_vars = c("emp"), lags = 4, predet_vars = c("wage"), exog_vars = c("cap"), transformation = "fd", data = abdata, panel_identifier = c("id", "year"), steps = c("twostep"), system_instruments = TRUE, max_instr_dependent_vars = 99, max_instr_predet_vars = 99, min_instr_dependent_vars = 2L, min_instr_predet_vars = 1L, collapse = FALSE ) ## End(Not run) data("ex3_abdata") summary(ex3_abdata) data("Dahlberg") ## Not run: ex1_dahlberg_data <- pvargmm(dependent_vars = c("expenditures", "revenues", "grants"), lags = 1, transformation = "fod", data = Dahlberg, panel_identifier=c("id", "year"), steps = c("twostep"), system_instruments = FALSE, max_instr_dependent_vars = 99, max_instr_predet_vars = 99, min_instr_dependent_vars = 2L, min_instr_predet_vars = 1L, collapse = FALSE ) ## End(Not run) data("ex1_dahlberg_data") summary(ex1_dahlberg_data)
## Not run: library(panelvar) data(abdata) ex3_abdata <-pvargmm( dependent_vars = c("emp"), lags = 4, predet_vars = c("wage"), exog_vars = c("cap"), transformation = "fd", data = abdata, panel_identifier = c("id", "year"), steps = c("twostep"), system_instruments = TRUE, max_instr_dependent_vars = 99, max_instr_predet_vars = 99, min_instr_dependent_vars = 2L, min_instr_predet_vars = 1L, collapse = FALSE ) ## End(Not run) data("ex3_abdata") summary(ex3_abdata) data("Dahlberg") ## Not run: ex1_dahlberg_data <- pvargmm(dependent_vars = c("expenditures", "revenues", "grants"), lags = 1, transformation = "fod", data = Dahlberg, panel_identifier=c("id", "year"), steps = c("twostep"), system_instruments = FALSE, max_instr_dependent_vars = 99, max_instr_predet_vars = 99, min_instr_dependent_vars = 2L, min_instr_predet_vars = 1L, collapse = FALSE ) ## End(Not run) data("ex1_dahlberg_data") summary(ex1_dahlberg_data)
This function estimates a stationary PVAR with fixed effects.
pvarhk( dependent_vars, exog_vars, transformation = c("demean"), data, panel_identifier = c(1, 2) )
pvarhk( dependent_vars, exog_vars, transformation = c("demean"), data, panel_identifier = c(1, 2) )
dependent_vars |
Dependent variables |
exog_vars |
Exogenous variables |
transformation |
Demeaning |
data |
Data set |
panel_identifier |
Vector of panel identifiers |
Hahn J., Kuehrsteiner G. (2002) Asymptotically Unbiased Inference for a Dynamic Panel Model with Fixed Effects When Both n and T Are Large, Econometrica, 70(4), 1639–1657
data(Dahlberg) ex1_hk <- pvarhk(dependent_vars = c("expenditures", "revenues", "grants"), transformation = "demean", data = Dahlberg, panel_identifier= c("id", "year")) summary(ex1_hk)
data(Dahlberg) ex1_hk <- pvarhk(dependent_vars = c("expenditures", "revenues", "grants"), transformation = "demean", data = Dahlberg, panel_identifier= c("id", "year")) summary(ex1_hk)
Extracting Level Residuals
residuals_level(model, ...) ## S3 method for class 'pvargmm' residuals_level(model, ...)
residuals_level(model, ...) ## S3 method for class 'pvargmm' residuals_level(model, ...)
model |
Model |
... |
Further arguments passed to or from other methods |
data("ex1_dahlberg_data") residuals_level(ex1_dahlberg_data)
data("ex1_dahlberg_data") residuals_level(ex1_dahlberg_data)
Standard Error S3 Method
se(object, ...) ## S3 method for class 'pvargmm' se(object, ...) ## S3 method for class 'pvarfeols' se(object, ...) ## S3 method for class 'pvarhk' se(object, ...)
se(object, ...) ## S3 method for class 'pvargmm' se(object, ...) ## S3 method for class 'pvarfeols' se(object, ...) ## S3 method for class 'pvarhk' se(object, ...)
object |
Object |
... |
Further arguments |
data("ex1_dahlberg_data") se(ex1_dahlberg_data)
data("ex1_dahlberg_data") se(ex1_dahlberg_data)
Stability of PVAR(p) model
stability(model, ...) ## S3 method for class 'pvargmm' stability(model, ...) ## S3 method for class 'pvarfeols' stability(model, ...)
stability(model, ...) ## S3 method for class 'pvargmm' stability(model, ...) ## S3 method for class 'pvarfeols' stability(model, ...)
model |
PVAR model |
... |
Further arguments |
A pvarstability
object containing eigenvalue stability conditions
data("ex1_dahlberg_data") stability_info <- stability(ex1_dahlberg_data) print(stability_info) plot(stability_info)
data("ex1_dahlberg_data") stability_info <- stability(ex1_dahlberg_data) print(stability_info) plot(stability_info)
S3 Summary Method for pvarfeols
## S3 method for class 'pvarfeols' summary(object, ...)
## S3 method for class 'pvarfeols' summary(object, ...)
object |
object |
... |
further arguments |
S3 Summary Method for pvargmm
## S3 method for class 'pvargmm' summary(object, ...)
## S3 method for class 'pvargmm' summary(object, ...)
object |
object |
... |
further arguments |
S3 Summary Method for pvarhk
## S3 method for class 'pvarhk' summary(object, ...)
## S3 method for class 'pvarhk' summary(object, ...)
object |
object |
... |
further arguments |