Title

phkd -- Kernel Density Estimation for Heterogeneous Panel Data

Syntax

phkd panelvar [if] [in][, options]

Order
acov_order(#) set order of the autocovariance; default is 0.

acor_order(#) set order of the autocorrelation; default is 1.

Method
method(strings:string) string must be one of three estimation method "naive", "hpj", "toj".

Graph
graph(strings:string) string must be a list consisting of mean, acov, acor; default is "mean acov acor".

ci(strings:string) string must be either "on" or "off"; default is "on".

panelvar must be xtset and strongly balanced.

Description

phkd performs kernel density estimation when the panel data exhibits heterogeneity across its cross-sectional units.
Densities of moments(mean, acov, acor) are calculated by usual kernel density estimation
using gaussian kernel with plug-in bandwidth on equally spaced grid of size 100.

Split-panel jackknife method like naive, hpj, toj are described in
Kernel Estimation for Panel Data with Heterogeneous Dynamics.

Dependencies

phkd requires the moremata
package. Type

. ssc describe moremata

phkd requires the kdens
package. Type

. ssc describe kdens

Options

Order

acov_order non-negative integer k for the order of autocovariance. The default is 0.

acor_order positive integer k for the order of autocorrelation. The default is 1.

Method

method(strings:string) specifies how the densities of moments are estimated.
"naive" stands for naive estimation without bias-correction, "hpj" for half panel jackknife and "toj" for third order jackknife.

Graph

graph(strings:string) specifies which graphs of densities to be plotted.

ci(strings:string) specifies whether to present confidence intervals on graphs or not

Results

phkd gives plots of densities and confidence intervals for mean, autocovariance and autocorrelation chosen by users.

Examples: kernel density estimation

Setup

. webuse pig

. xtset id week

Kernel Estimate the variable weight about mean and autocorrelation of order 3 using half panel jackknife

. phkd weight, method("hpj") ci("on") acor_order(3) graph("mean acor")

References

Ryo Okui. and Takahide Yanagi. 2019.
Kernel Estimation for Panel Data with Heterogeneous Dynamics.
The Econometrics Journal.

Ryo Okui. and Takahide Yanagi. 2019.
Panel Data Analysis with Heterogeneous Dynamics.
Journal of Econometrics.