Title: | Panel Data Analysis with Heterogeneous Dynamics |
---|---|
Description: | Understanding the dynamics of potentially heterogeneous variables is important in statistical applications. This package provides tools for estimating the degree of heterogeneity across cross-sectional units in the panel data analysis. The methods are developed by Okui and Yanagi (2019) <doi:10.1016/j.jeconom.2019.04.036> and Okui and Yanagi (2020) <doi:10.1093/ectj/utz019>. |
Authors: | Ryo Okui [aut, cph],
Takahide Yanagi [aut, cre, cph]
|
Maintainer: | Takahide Yanagi <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.0.1 |
Built: | 2025-02-18 04:57:10 UTC |
Source: | https://github.com/tkhdyanagi/panelhetero |
The 'hpjecdf()' function enables to implement the HPJ bias-corrected estimation of the cumulative distribution function (CDF) of the heterogeneous mean, the heterogeneous autocovariance, and the heterogeneous autocorrelation. The method is developed by Okui and Yanagi (2019). For more details, see the package vignette with 'vignette("panelhetero")'.
hpjecdf(data, acov_order = 0, acor_order = 1, R = 1000, ci = TRUE)
hpjecdf(data, acov_order = 0, acor_order = 1, R = 1000, ci = TRUE)
data |
A matrix of panel data. Each row corresponds to individual time series. |
acov_order |
A non-negative integer of the order of autocovariance. Default is 0. |
acor_order |
A positive integer of the order of autocorrelation. Default is 1. |
R |
A positive integer of the number of bootstrap repetitions. Default is 1000. |
ci |
A logical whether to estimate the confidence interval. Default is TRUE. |
A list that contains the following elements.
mean |
A plot of the corresponding CDF |
acov |
A plot of the corresponding CDF |
acor |
A plot of the corresponding CDF |
mean_func |
A function that returns the corresponding CDF |
acov_func |
A function that returns the corresponding CDF |
acor_func |
A function that returns the corresponding CDF |
mean_ci_func |
A function that returns the 95 percent confidence interval for the corresponding CDF |
acov_ci_func |
A function that returns the 95 percent confidence interval for the corresponding CDF |
acor_ci_func |
A function that returns the 95 percent confidence interval for the corresponding CDF |
quantity |
A matrix of the estimated heterogeneous quantities |
acov_order |
The order of autocovariance |
acor_order |
The order of autocorrelation |
N |
The number of cross-sectional units |
S |
The length of time series |
R |
The number of bootstrap repetitions |
Okui, R. and Yanagi, T., 2019. Panel data analysis with heterogeneous dynamics. Journal of Econometrics, 212(2), pp.451-475.
data <- panelhetero::simulation(N = 300, S = 50) panelhetero::hpjecdf(data = data, R = 50)
data <- panelhetero::simulation(N = 300, S = 50) panelhetero::hpjecdf(data = data, R = 50)
The 'hpjkd()' function enables to implement the HPJ bias-corrected kernel density estimation for the heterogeneous mean, the autocovariance, and the autocorrelation. The method is developed by Okui and Yanagi (2020). For more details, see the package vignette with 'vignette("panelhetero")'.
hpjkd( data, acov_order = 0, acor_order = 1, mean_bw = NULL, acov_bw = NULL, acor_bw = NULL )
hpjkd( data, acov_order = 0, acor_order = 1, mean_bw = NULL, acov_bw = NULL, acor_bw = NULL )
data |
A matrix of panel data. Each row corresponds to individual time series. |
acov_order |
A non-negative integer of the order of autocovariance. Default is 0. |
acor_order |
A positive integer of the order of autocorrelation. Default is 1. |
mean_bw |
A scalar of bandwidth used for the estimation of the denisty of mean. Default is NULL, and the plug-in bandwidth is used. |
acov_bw |
A scalar of bandwidth used for the estimation of the denisty of autocovariance. Default is NULL, and the plug-in bandwidth is used. |
acor_bw |
A scalar of bandwidth used for the estimation of the denisty of autocorrelation. Default is NULL, and the plug-in bandwidth is used. |
A list that contains the following elements:
mean |
A plot of the corresponding density |
acov |
A plot of the corresponding density |
acor |
A plot of the corresponding density |
mean_func |
A function that returns the corresponding density |
acov_func |
A function that returns the corresponding density |
acor_func |
A function that returns the corresponding density |
bandwidth |
A Vector of the bandwidths |
quantity |
A matrix of the estimated heterogeneous quantities |
acov_order |
The order of autocovariance |
acor_order |
The order of autocorrelation |
N |
The number of cross-sectional units |
S |
The length of time series |
Okui, R. and Yanagi, T., 2020. Kernel estimation for panel data with heterogeneous dynamics. The Econometrics Journal, 23(1), pp.156-175.
data <- panelhetero::simulation(N = 300, S = 50) panelhetero::hpjkd(data = data)
data <- panelhetero::simulation(N = 300, S = 50) panelhetero::hpjkd(data = data)
The 'hpjmoment()' function enables to implement the HPJ bias-corrected estimation of the moments of the heterogeneous mean, the heterogeneous autocovariance, and the heterogeneous autocorrelation. The method is developed by Okui and Yanagi (2019). For more details, see the package vignette with 'vignette("panelhetero")'.
hpjmoment(data, acov_order = 0, acor_order = 1, R = 1000)
hpjmoment(data, acov_order = 0, acor_order = 1, R = 1000)
data |
A matrix of panel data. Each row corresponds to individual time series. |
acov_order |
A non-negative integer of the order of autocovariance. Default is 0. |
acor_order |
A positive integer of the order of autocorrelation Default is 1. |
R |
A positive integer of the number of bootstrap repetitions. Default is 1000. |
A list that contains the following elements.
estimate |
A vector of the parameter estimates |
se |
A vector of the standard errors |
ci |
A matrix of the 95 percent confidence intervals |
quantity |
A matrix of the estimated heterogeneous quantities |
acov_order |
The order of autocovariance |
acor_order |
The order of autocovariance |
N |
The number of cross-sectional units |
S |
The length of time series |
R |
The number of bootstrap repetitions |
Okui, R. and Yanagi, T., 2019. Panel data analysis with heterogeneous dynamics. Journal of Econometrics, 212(2), pp.451-475.
data <- panelhetero::simulation(N = 300, S = 50) panelhetero::hpjmoment(data = data)
data <- panelhetero::simulation(N = 300, S = 50) panelhetero::hpjmoment(data = data)
The 'neecdf()' function enables to implement the naive estimation of the cumulative distribution function (CDF) of the heterogeneous mean, the heterogeneous autocovariance, and the heterogeneous autocorrelation. The method is developed by Okui and Yanagi (2019). For more details, see the package vignette with 'vignette("panelhetero")'.
neecdf(data, acov_order = 0, acor_order = 1, R = 1000, ci = TRUE)
neecdf(data, acov_order = 0, acor_order = 1, R = 1000, ci = TRUE)
data |
A matrix of panel data. Each row corresponds to individual time series. |
acov_order |
A non-negative integer of the order of autocovariance. Default is 0. |
acor_order |
A positive integer of the order of autocorrelation. Default is 1. |
R |
A positive integer of the number of bootstrap repetitions. Default is 1000. |
ci |
A logical whether to estimate the confidence interval. Default is TRUE. |
A list that contains the following elements.
mean |
A plot of the corresponding CDF |
acov |
A plot of the corresponding CDF |
acor |
A plot of the corresponding CDF |
mean_func |
A function that returns the corresponding CDF |
acov_func |
A function that returns the corresponding CDF |
acor_func |
A function that returns the corresponding CDF |
mean_ci_func |
A function that returns the 95 percent confidence interval for the corresponding CDF |
acov_ci_func |
A function that returns the 95 percent confidence interval for the corresponding CDF |
acor_ci_func |
A function that returns the 95 percent confidence interval for the corresponding CDF |
quantity |
A matrix of the estimated heterogeneous quantities |
acov_order |
The order of autocovariance |
acor_order |
The order of autocorrelation |
N |
The number of cross-sectional units |
S |
The length of time series |
R |
The number of bootstrap repetitions |
Okui, R. and Yanagi, T., 2019. Panel data analysis with heterogeneous dynamics. Journal of Econometrics, 212(2), pp.451-475.
data <- panelhetero::simulation(N = 300, S = 50) panelhetero::neecdf(data = data, R = 50)
data <- panelhetero::simulation(N = 300, S = 50) panelhetero::neecdf(data = data, R = 50)
The 'nekd()' function enables to implement the naive kernel density estimation without bias correction for the heterogeneous mean, the autocovariance, and the autocorrelation. The method is developed by Okui and Yanagi (2020). For more details, see the package vignette with 'vignette("panelhetero")'.
nekd( data, acov_order = 0, acor_order = 1, mean_bw = NULL, acov_bw = NULL, acor_bw = NULL )
nekd( data, acov_order = 0, acor_order = 1, mean_bw = NULL, acov_bw = NULL, acor_bw = NULL )
data |
A matrix of panel data. Each row corresponds to individual time series. |
acov_order |
A non-negative integer of the order of autocovariance. Default is 0. |
acor_order |
A positive integer of the order of autocorrelation. Default is 1. |
mean_bw |
A scalar of bandwidth used for the estimation of the denisty of mean. Default is NULL, and the plug-in bandwidth is used. |
acov_bw |
A scalar of bandwidth used for the estimation of the denisty of autocovariance. Default is NULL, and the plug-in bandwidth is used. |
acor_bw |
A scalar of bandwidth used for the estimation of the denisty of autocorrelation. Default is NULL, and the plug-in bandwidth is used. |
A list that contains the following elements:
mean |
A plot of the corresponding density |
acov |
A plot of the corresponding density |
acor |
A plot of the corresponding density |
mean_func |
A function that returns the corresponding density |
acov_func |
A function that returns the corresponding density |
acor_func |
A function that returns the corresponding density |
bandwidth |
A Vector of the bandwidths |
quantity |
A matrix of the estimated heterogeneous quantities |
acov_order |
The order of autocovariance |
acor_order |
The order of autocorrelation |
N |
The number of cross-sectional units |
S |
The length of time series |
Okui, R. and Yanagi, T., 2020. Kernel estimation for panel data with heterogeneous dynamics. The Econometrics Journal, 23(1), pp.156-175.
data <- panelhetero::simulation(N = 300, S = 50) panelhetero::nekd(data = data)
data <- panelhetero::simulation(N = 300, S = 50) panelhetero::nekd(data = data)
The 'nemoment()' function enables to implement the naive estimation of the moments of the heterogeneous mean, the heterogeneous autocovariance, and the heterogeneous autocorrelation. The method is developed by Okui and Yanagi (2019). For more details, see the package vignette with 'vignette("panelhetero")'.
nemoment(data, acov_order = 0, acor_order = 1, R = 1000)
nemoment(data, acov_order = 0, acor_order = 1, R = 1000)
data |
A matrix of panel data. Each row corresponds to individual time series. |
acov_order |
A non-negative integer of the order of autocovariance. Default is 0. |
acor_order |
A positive integer of the order of autocorrelation Default is 1. |
R |
A positive integer of the number of bootstrap repetitions. Default is 1000. |
A list that contains the following elements.
estimate |
A vector of the parameter estimates |
se |
A vector of the standard errors |
ci |
A matrix of the 95 percent confidence intervals |
quantity |
A matrix of the estimated heterogeneous quantities |
acov_order |
The order of autocovariance |
acor_order |
The order of autocovariance |
N |
The number of cross-sectional units |
S |
The length of time series |
R |
The number of bootstrap repetitions |
Okui, R. and Yanagi, T., 2019. Panel data analysis with heterogeneous dynamics. Journal of Econometrics, 212(2), pp.451-475.
data <- panelhetero::simulation(N = 300, S = 50) panelhetero::nemoment(data = data)
data <- panelhetero::simulation(N = 300, S = 50) panelhetero::nemoment(data = data)
The 'simulation()' function enables to generate artificial data from an AR(1) model with random coefficients. The function is used in the package vignette.
simulation(N, S)
simulation(N, S)
N |
The number of cross-sectional units |
S |
The length of time series |
An N times S matrix of panel data
panelhetero::simulation(N = 300, S = 50)
panelhetero::simulation(N = 300, S = 50)
The 'tojecdf()' function enables to implement the TOJ bias-corrected estimation of the cumulative distribution function (CDF) of the heterogeneous mean, the heterogeneous autocovariance, and the heterogeneous autocorrelation. The method is developed by Okui and Yanagi (2019). For more details, see the package vignette with 'vignette("panelhetero")'.
tojecdf(data, acov_order = 0, acor_order = 1, R = 1000, ci = TRUE)
tojecdf(data, acov_order = 0, acor_order = 1, R = 1000, ci = TRUE)
data |
A matrix of panel data. Each row corresponds to individual time series. |
acov_order |
A non-negative integer of the order of autocovariance. Default is 0. |
acor_order |
A positive integer of the order of autocorrelation. Default is 1. |
R |
A positive integer of the number of bootstrap repetitions. Default is 1000. |
ci |
A logical whether to estimate the confidence interval. Default is TRUE. |
A list that contains the following elements.
mean |
A plot of the corresponding CDF |
acov |
A plot of the corresponding CDF |
acor |
A plot of the corresponding CDF |
mean_func |
A function that returns the corresponding CDF |
acov_func |
A function that returns the corresponding CDF |
acor_func |
A function that returns the corresponding CDF |
mean_ci_func |
A function that returns the 95 percent confidence interval for the corresponding CDF |
acov_ci_func |
A function that returns the 95 percent confidence interval for the corresponding CDF |
acor_ci_func |
A function that returns the 95 percent confidence interval for the corresponding CDF |
quantity |
A matrix of the estimated heterogeneous quantities |
acov_order |
The order of autocovariance |
acor_order |
The order of autocorrelation |
N |
The number of cross-sectional units |
S |
The length of time series |
R |
The number of bootstrap repetitions |
Okui, R. and Yanagi, T., 2019. Panel data analysis with heterogeneous dynamics. Journal of Econometrics, 212(2), pp.451-475.
data <- panelhetero::simulation(N = 300, S = 50) panelhetero::tojecdf(data = data, R = 50)
data <- panelhetero::simulation(N = 300, S = 50) panelhetero::tojecdf(data = data, R = 50)
The 'tojkd()' function enables to implement the TOJ bias-corrected kernel density estimation for the heterogeneous mean, the autocovariance, and the autocorrelation. The method is developed by Okui and Yanagi (2020). For more details, see the package vignette with 'vignette("panelhetero")'.
tojkd( data, acov_order = 0, acor_order = 1, mean_bw = NULL, acov_bw = NULL, acor_bw = NULL )
tojkd( data, acov_order = 0, acor_order = 1, mean_bw = NULL, acov_bw = NULL, acor_bw = NULL )
data |
A matrix of panel data. Each row corresponds to individual time series. |
acov_order |
A non-negative integer of the order of autocovariance. Default is 0. |
acor_order |
A positive integer of the order of autocorrelation. Default is 1. |
mean_bw |
A scalar of bandwidth used for the estimation of the denisty of mean. Default is NULL, and the plug-in bandwidth is used. |
acov_bw |
A scalar of bandwidth used for the estimation of the denisty of autocovariance. Default is NULL, and the plug-in bandwidth is used. |
acor_bw |
A scalar of bandwidth used for the estimation of the denisty of autocorrelation. Default is NULL, and the plug-in bandwidth is used. |
A list that contains the following elements:
mean |
A plot of the corresponding density |
acov |
A plot of the corresponding density |
acor |
A plot of the corresponding density |
mean_func |
A function that returns the corresponding density |
acov_func |
A function that returns the corresponding density |
acor_func |
A function that returns the corresponding density |
bandwidth |
A Vector of the bandwidths |
quantity |
A matrix of the estimated heterogeneous quantities |
acov_order |
The order of autocovariance |
acor_order |
The order of autocorrelation |
N |
The number of cross-sectional units |
S |
The length of time series |
Okui, R. and Yanagi, T., 2020. Kernel estimation for panel data with heterogeneous dynamics. The Econometrics Journal, 23(1), pp.156-175.
data <- panelhetero::simulation(N = 300, S = 50) panelhetero::tojkd(data = data)
data <- panelhetero::simulation(N = 300, S = 50) panelhetero::tojkd(data = data)
The 'tojmoment()' function enables to implement the TOJ bias-corrected estimation of the moments of the heterogeneous mean, the heterogeneous autocovariance, and the heterogeneous autocorrelation. The method is developed by Okui and Yanagi (2019). For more details, see the package vignette with 'vignette("panelhetero")'.
tojmoment(data, acov_order = 0, acor_order = 1, R = 1000)
tojmoment(data, acov_order = 0, acor_order = 1, R = 1000)
data |
A matrix of panel data. Each row corresponds to individual time series. |
acov_order |
A non-negative integer of the order of autocovariance. Default is 0. |
acor_order |
A positive integer of the order of autocorrelation Default is 1. |
R |
A positive integer of the number of bootstrap repetitions. Default is 1000. |
A list that contains the following elements.
estimate |
A vector of the parameter estimates |
se |
A vector of the standard errors |
ci |
A matrix of the 95 percent confidence intervals |
quantity |
A matrix of the estimated heterogeneous quantities |
acov_order |
The order of autocovariance |
acor_order |
The order of autocovariance |
N |
The number of cross-sectional units |
S |
The length of time series |
R |
The number of bootstrap repetitions |
Okui, R. and Yanagi, T., 2019. Panel data analysis with heterogeneous dynamics. Journal of Econometrics, 212(2), pp.451-475.
data <- panelhetero::simulation(N = 300, S = 50) panelhetero::tojmoment(data = data)
data <- panelhetero::simulation(N = 300, S = 50) panelhetero::tojmoment(data = data)