### Install xtdcce2 from GitHub Source: https://github.com/janditzen/xtdcce2/blob/master/README.md Use this command to install the latest stable version of xtdcce2 directly from its GitHub repository. ```stata net install xtdcce2 , from("https://janditzen.github.io/xtdcce2/") ``` -------------------------------- ### Install xtdcce2 Beta Versions from GitHub Source: https://github.com/janditzen/xtdcce2/blob/master/README.md This command allows installation of beta versions of xtdcce2, which may include experimental features or fixes. ```stata net from https://janditzen.github.io/xtdcce2/ ``` -------------------------------- ### Install xtdcce2 Beta Versions (Pre v1.34) Source: https://github.com/janditzen/xtdcce2/blob/master/README.md Use this command to access and install beta versions of xtdcce2 released before version 1.34. ```stata net from http://www.ditzen.net/Stata/xtdcce2_beta ``` -------------------------------- ### Install xtdcce2 from SSC Source: https://github.com/janditzen/xtdcce2/blob/master/README.md This command installs the xtdcce2 package from the Statistical Software Components (SSC) archive, a common source for Stata user-written packages. ```stata ssc install xtdcce2 ``` -------------------------------- ### Estimate CS-ARDL Model with ARDL(3,3,3) without Parentheses Source: https://github.com/janditzen/xtdcce2/blob/master/README.md This command estimates the same CS-ARDL model as the previous example but without using parentheses to group variables. It demonstrates an equivalent way to specify the long-run coefficients. ```stata xtdcce2 d.y , lr(L(1/3).d.y L(0/3).dp L(0/3).d.gd) lr_options(ardl) cr(d.y dp d.gd) cr_lags(3) fullsample ``` -------------------------------- ### Bootstrap Standard Errors with Fixed Seed Source: https://github.com/janditzen/xtdcce2/blob/master/README.md This command bootstraps standard errors with a fixed seed for reproducibility. It is a basic setup for bootstrapping in Stata. ```stata estat bootstrap, seed(123) ``` -------------------------------- ### Information Criteria for a Single Model (Single Option) Source: https://github.com/janditzen/xtdcce2/blob/master/README.md Get Information Criteria for a single, specified model of cross-section averages using the 'single' option. This is useful for comparing a specific model against all combinations. ```stata estat ic, model(log_hc log_ck ) single ``` -------------------------------- ### Information Criteria Calculation Source: https://github.com/janditzen/xtdcce2/blob/master/README.md Information Criteria (IC1, IC2, PC1, PC2) guide the selection of optimal cross-section averages. IC1 and IC2 are calculated automatically by xtdcce2. PC1 and PC2 can be calculated using `estat ic`. These criteria are only valid for static panel models. ```stata xtdcce2 ``` ```stata estat ic ``` -------------------------------- ### Run Wild Bootstrap and Bootstrap Confidence Intervals Source: https://github.com/janditzen/xtdcce2/blob/master/README.md This command performs a wild bootstrap and calculates bootstrap confidence intervals. It includes options for 'wild' bootstrapping and 'percentile' confidence intervals, along with a fixed seed. ```stata estat bootstrap, seed(123) wild percentile ``` -------------------------------- ### xtdcce2 Syntax Source: https://github.com/janditzen/xtdcce2/blob/master/README.md Standard syntax for the xtdcce2 command, used for estimating heterogeneous coefficient models with common correlated effects in a dynamic panel. ```stata xtdcce2 _depvar_ [_indepvars_] [_varlist2_ = _varlist_iv_] [ifin] , crosssectional(_varlist_[,cr_lags(_numlist_) rcce[(criterion(er/gr) scale npc(integer))] rcclassifier[(er gr replications(integer) standardize(integer) randomshrinkage noshrinkage)]]) [clustercrosssectional(_varlist_, clustercr(_varlist_) [cr_lags(_numlist_)]) globalcrosssectional(_varlist_[,cr_lags(_numlist_)]) pooled(_varlist_) cr_lags(_numlist_) NOCRosssectional ivreg2options(_string_) e_ivreg2_ ivslow noisily lr(_varlist_) lr_options(_string_) pooledconstant reportconstant pooledvce(_string_) noconstant trend pooledtrend jackknife recursive nocd exponent xtcse2options(_string_) showindividual fullsample fast fast2 blockdiaguse nodimcheck useqr useinvsym noomitted mgmissing] ``` -------------------------------- ### Predict xb vs xb2 calculation Source: https://github.com/janditzen/xtdcce2/blob/master/README.md Illustrates the difference in calculation between predict xb and xb2 options. xb calculates linear prediction on partialled out variables, while xb2 calculates on non-partialled out variables. ```stata 1. predict coeff, coeff 2. predict partial, partial 3. gen xb = coeff_x * partial_x ``` ```stata 1. predict coeff, coeff 2. gen xb2 = coeff_x * x ``` -------------------------------- ### xtdcce2fast Syntax Source: https://github.com/janditzen/xtdcce2/blob/master/README.md Optimized syntax for the xtdcce2fast command, designed for speed and large datasets in panel time series models with cross-sectional dependence. ```stata xtdcce2fast _depvar_ [_indepvars_] [ifin] , crosssectional(_varlist_[,cr_lags(_numlist_) rcce[(criterion(er/gr) scale npc(integer))] rcclassifier[(er gr replications(integer) standardize(integer) randomshrinkage noshrinkage)]]) [clustercrosssectional(_varlist_, clustercr(_varlist_) [cr_lags(_numlist_)]) globalcrosssectional(_varlist_[,cr_lags(_numlist_)]) cr_lags(_string_) NOCRosssectional lr(_varlist_) lr_options(_string_) reportconstant noconstant cd fullsample notable cd postframe nopost ] ``` -------------------------------- ### Estimate CS-ARDL Model with ARDL(3,3,3) using Parentheses Source: https://github.com/janditzen/xtdcce2/blob/master/README.md This command estimates a CS-ARDL model with an ARDL(3,3,3) specification, using parentheses to group variables that form the same long-run coefficient. This is an alternative to using _tsvarlist_ operators. ```stata xtdcce2 d.y , lr((L(1/3).d.y) (L(0/3).dp) (L(0/3).d.gd) ) lr_options(ardl) cr(d.y dp d.gd) cr_lags(3) fullsample ``` -------------------------------- ### Estimate Panel Model and Run CD Test Source: https://github.com/janditzen/xtdcce2/blob/master/README.md Estimates a panel version of the Solow model and then runs the standard CD test. Ensure data is tsset. ```stata reg d.log_rgdpo log_hc log_ck log_ngd xtcd2 ``` -------------------------------- ### Run CD Test with Kernel Density Plot Source: https://github.com/janditzen/xtdcce2/blob/master/README.md Runs the CD test and generates a kernel density plot of the cross-correlations using the 'kdensity' option. This helps visualize the distribution of cross-correlations. ```stata xtcd2 res, kdensity ``` -------------------------------- ### xtcd2 Command Syntax for Testing Cross-Sectional Dependence Source: https://github.com/janditzen/xtdcce2/blob/master/README.md The general syntax for the xtcd2 command, used to test for weak cross-sectional dependence in panel data models. It accepts a list of variables or residuals and various options for different test statistics. ```stata xtcd2 [varlist] [if] [,pesaran cdw pea cdstar rho pca(integer) reps(integer) seed(integer) kdensity name(string) heatplot[(absolute options_heatplot)] contour[(absolute options_contour) noadjust] ] ``` -------------------------------- ### Predict command syntax Source: https://github.com/janditzen/xtdcce2/blob/master/README.md The general syntax for the predict command after running xtdcce2. Specify the new variable name and the desired output type. ```stata predict [type] _newvar_ _ifin_ [ options ] ``` -------------------------------- ### Estimate ECM/PMG Model with XTPMG Naming Convention Source: https://github.com/janditzen/xtdcce2/blob/master/README.md Estimates an ECM/PMG model using the 'xtpmgnames' option to match the naming convention of the 'xtpmg' command. ```stata xtdcce2 d.c d.pi d.y if year >= 1962 , lr(L.c pi y) p(L.c pi y) nocross lr_options(xtpmgnames) ``` -------------------------------- ### Run CD Test with Power Enhancement Approach Source: https://github.com/janditzen/xtdcce2/blob/master/README.md Applies the Power Enhancement Approach (PEA) using the 'pea' option to improve the power of the weighted CD test. Requires data to be tsset. ```stata xtcd2 res, pea ``` -------------------------------- ### Run Weighted CD Test with Multiple Repetitions Source: https://github.com/janditzen/xtdcce2/blob/master/README.md Performs the weighted CD test multiple times with different weights using the 'reps()' option to reduce dependence on specific weightings. Requires the 'cdw' option to be active. ```stata xtcd2 res, cdw reps(20) ``` -------------------------------- ### Bootstrap Confidence Intervals with estat Source: https://github.com/janditzen/xtdcce2/blob/master/README.md Use 'estat bootstrap' to calculate confidence intervals and standard errors. Supports wild and cross-section bootstraps. Default repetitions are 100. ```stata estat bootstrap , [options] ``` -------------------------------- ### Calculate Information Criteria with estat Source: https://github.com/janditzen/xtdcce2/blob/master/README.md Use 'estat ic' to calculate information criteria for selecting the optimal number of cross-section averages. Only valid for static panels. ```stata estat ic , [options] ``` -------------------------------- ### Econometric Model Equation (1) Source: https://github.com/janditzen/xtdcce2/blob/master/README.md Defines a dynamic panel data model with heterogeneous coefficients and unobserved common factors. This equation serves as the theoretical basis for the empirical models discussed. ```mathematica y(i,t) = b0(i) + b1(i)*y(i,t-1) + x(i,t)*b2(i) + x(i,t-1)*b3(i) + u(i,t) u(i,t) = g(i)*f(t) + e(i,t) ``` -------------------------------- ### Estimate Mean Group Growth Equation with Constant Source: https://github.com/janditzen/xtdcce2/wiki/Home Estimates a growth equation using the mean group approach, ensuring the constant is reported separately. Use the 'reportc' option to include the constant in the output. ```stata xtdcce2 d.log_rgdpo L.log_rgdpo log_hc log_ck log_ngd , nocross reportc. ``` -------------------------------- ### Predict residuals calculation Source: https://github.com/janditzen/xtdcce2/blob/master/README.md Demonstrates how to calculate residuals (e(i,t)) using the 'residuals' option. This represents the residuals of the regression with cross-sectional averages partialled out. ```stata predict _newvar_ , residuals ``` -------------------------------- ### Cross-Section Augmented Distributed Lag (CS-DL) Model Initial Equation Source: https://github.com/janditzen/xtdcce2/blob/master/README.md This equation represents the initial CS-DL model formulation for estimating the long run effect of x on y, including cross-sectional averages and differences of explanatory variables. ```mathematica (8) y(i,t) = w0(i) + x(i,t) * w2(i) + delta(i) * (x(i,t) - x(i,t-1)) + sum [d(i)*z(i,s)] + e(i,t) ``` -------------------------------- ### Predict Residuals and Run CD Test Source: https://github.com/janditzen/xtdcce2/blob/master/README.md Predicts residuals from a regression and then runs the CD test on these residuals. This is an alternative to running xtcd2 directly after regression. ```stata reg d.log_rgdpo log_hc log_ck log_ngd predict res, residuals xtcd2 res ``` -------------------------------- ### Estimate Static rCCE Model with Fixed Number of Eigenvectors Source: https://github.com/janditzen/xtdcce2/blob/master/README.md This command estimates a static rCCE model by hard-setting the number of regularized cross-section averages to three using the 'npc()' option. This bypasses the need to specify a selection criterion. ```stata xtdcce2 log_rgdpo log_hc log_ck log_ngd , cr(log_rgdpo log_hc log_ck log_ngd, rcce(npc(3))) ``` -------------------------------- ### Estimate Static rCCE Model Source: https://github.com/janditzen/xtdcce2/blob/master/README.md This command estimates a static Regularized CCE model for growth on human capital, physical capital, and population growth. It uses the default ER criterion for selecting eigenvectors. ```stata xtdcce2 log_rgdpo log_hc log_ck log_ngd , cr(log_rgdpo log_hc log_ck log_ngd, rcce) ``` -------------------------------- ### Information Criteria for Specific Model Combinations Source: https://github.com/janditzen/xtdcce2/blob/master/README.md Calculate Information Criteria for three different sets of cross-section averages, specified using the 'model()' option. The first model listed serves as the reference. ```stata estat ic, model( (d.log_rgdpo log_hc log_ck log_ngd) (log_hc log_ck log_ngd) (log_hc log_ck ) ) ``` -------------------------------- ### Rank Condition Classifier with Default Settings Source: https://github.com/janditzen/xtdcce2/blob/master/README.md Calculate the rank condition classifier using the default settings for the CCE estimator. This is useful for ensuring consistent estimation in panel data models. ```stata xtdcce2 d.log_rgdpo log_hc log_ck log_ngd , cr(_all, rccl) reportc ``` -------------------------------- ### Information Criteria for a Single Model (Without Single Option) Source: https://github.com/janditzen/xtdcce2/blob/master/README.md Calculate Information Criteria for a single model of cross-section averages without the 'single' option. This will compare the specified model against all possible combinations. ```stata estat ic, model(log_hc log_ck log_ngd) ``` -------------------------------- ### Standardize Variable for BKP Table 1 Reproduction Source: https://github.com/janditzen/xtdcce2/blob/master/README.md Use xtcse2 with the 'standardize' option to standardize a variable, as done in the BKP paper for reproducing Table 1. This is useful when working with data that requires specific preprocessing steps. ```Stata xtcse2 gdp , standardize. ``` -------------------------------- ### Estimate ARDL(3,3,3) without parenthesis Source: https://github.com/janditzen/xtdcce2/wiki/Home Provides an equivalent specification to the parenthesized version for ARDL(3,3,3) estimation without using parentheses for variable grouping. This relies on xtdcce2's default variable recognition. ```stata xtdcce2133 d.y , lr(L(1/3).d.y L(0/3).dp L(0/3).d.gd) lr_options(ardl) cr(d.y dp d.gd) cr_lags(3) fullsample ``` -------------------------------- ### Create Bar Plot with estat Source: https://github.com/janditzen/xtdcce2/blob/master/README.md Use 'estat bar' to generate a bar plot. Options like 'individual()' and 'combine()' can be used for customization. ```stata estat bar _varlist_ {ifin} [,combine(_string_) individual(_string_) nomg cleargraph] ``` -------------------------------- ### Sequential Information Criteria Calculation Source: https://github.com/janditzen/xtdcce2/blob/master/README.md Calculate Information Criteria for all possible combinations of cross-section averages and indicate the lowest ones. This sequential approach helps in identifying the optimal set of averages. ```stata estat ic, seqential ``` -------------------------------- ### Pooled Estimations Equations Source: https://github.com/janditzen/xtdcce2/blob/master/README.md These equations represent pooled estimations where parameters are constrained to be the same across units. The 'pooled(_varlist_)' option pools variables, and 'pooledconstant' pools the constant term. ```mathematica (3-p) y(i,t) = b0 + b1*y(i,t-1) + x(i,t)*b2 + e(i,t), (4-p) y(i,t) = b0 + x(i,t)*b2 + d(i)*z(i,t) + e(i,t), (5-p) y(i,t) = b0 + b1*y(i,t-1) + x(i,t)*b2 + sum [d(i)*z(i,s)] + e(i,t). ``` -------------------------------- ### Create Box Plot with estat Source: https://github.com/janditzen/xtdcce2/blob/master/README.md Use 'estat box' to generate a box plot. Ensure the graph type and any necessary options are specified. ```stata estat box _varlist_ {ifin} [,combine(_string_) individual(_string_) nomg cleargraph] ``` -------------------------------- ### Instrumental Variables Estimation Source: https://github.com/janditzen/xtdcce2/wiki/Home Uses 'endogenous_vars' and 'exogenous_vars' to specify instrumental variables. 'ivreg2options' can pass further options to ivreg2. 'fulliv' posts stored values from ivreg2. ```stata xtdcce2 d.log_rgdpo L.log_rgdpo log_hc log_ck log_ngd (log_ck = L.log_ck), reportc cr(d.log_rgdpo L.log_rgdpo log_hc log_ck log_ngd) cr_lags(3) ivreg2options(nocollin noid). ``` -------------------------------- ### Estimate ARDL(3,3,3) with parenthesized variables Source: https://github.com/janditzen/xtdcce2/wiki/Home Estimates an ARDL(3,3,3) model with xtdcce2, using parentheses to group variables that form the same long-run coefficient. This is an alternative to using tsvarlist operators. ```stata xtdcce2133 d.y , lr((L(1/3).d.y) (L(0/3).dp) (L(0/3).d.gd) ) lr_options(ardl) cr(d.y dp d.gd) cr_lags(3) fullsample ``` -------------------------------- ### Pooled Estimations with Pooled Constant Source: https://github.com/janditzen/xtdcce2/wiki/Home Pools all coefficients and the constant using the 'pooled' and 'pooledconstant' options. Ensure variables are correctly specified in 'reportc' and 'cr'. ```stata xtdcce2 d.log_rgdpo L.log_rgdpo log_hc log_ck log_ngd , reportc cr(d.log_rgdpo L.log_rgdpo log_hc log_ck log_ngd) pooled(L.log_rgdpo log_hc log_ck log_ngd) cr_lags(3) pooledconstant. ``` -------------------------------- ### Estimate Dynamic Growth Equation with Lags Source: https://github.com/janditzen/xtdcce2/blob/master/README.md Estimate a dynamic growth equation using xtdcce2, incorporating lags of cross-sectional averages. The number of lags is suggested to be around T^(1/3). After estimation, use xtcse2 with 'nocd' and 'residual' options to test for residual dependence and estimate alpha. ```Stata xtdcce2 log_rgdpo L.log_rgdpo log_ck log_ngd log_hc , cr(log_rgdpo log_ck log_ngd log_hc) cr_lags(3) . xtcse2 ,nocd residual lags(3) reps(200) ``` -------------------------------- ### Estimate Static rCCE Model with GR Criterion Source: https://github.com/janditzen/xtdcce2/blob/master/README.md This command estimates a static rCCE model using the GR criterion instead of the default ER criterion for selecting eigenvectors. This allows for a different selection method for the regularized cross-section averages. ```stata xtdcce2 log_rgdpo log_hc log_ck log_ngd , cr(log_rgdpo log_hc log_ck log_ngd, rcce(criterion(gr))) ``` -------------------------------- ### Run Weighted CD Test with Rademacher Weights Source: https://github.com/janditzen/xtdcce2/blob/master/README.md Applies unit-specific rademacher weights using the 'cdw' option to prevent the CD test statistic from diverging, especially when many periodic specific parameters are used. Requires data to be tsset. ```stata xtcd2 res, cdw ``` -------------------------------- ### Information Criteria for Cross-Section Averages (Default) Source: https://github.com/janditzen/xtdcce2/blob/master/README.md Obtain Information Criteria (IC1 and IC2) for the current set of cross-section averages defined in the model. This is a standard step when using information criteria for model selection. ```stata xtdcce2 d.log_rgdpo log_hc log_ck log_ngd , cr(_all) reportc estat ic ``` -------------------------------- ### Estimate Exponent of Cross-Sectional Dependence Source: https://github.com/janditzen/xtdcce2/blob/master/README.md Estimates the exponent of cross-sectional dependence using the xtcse2 command. Data must be xtset. Can predict residuals if varlist is empty. ```stata xtcse2 [varlist] [if] [, pca(integer) standardize nocenter nocd RESsidual Reps(integer) size(real) tuning(real) lags(integer) ] ``` -------------------------------- ### Estimate ARDL(1,1,1) with cross-sectional averages Source: https://github.com/janditzen/xtdcce2/wiki/Home Estimates an ARDL(1,1,1) model using xtdcce2, specifying long-run variables and lags of cross-sectional averages. Use this when variables are not enclosed in parentheses. ```stata xtdcce2 d.y , lr(L.d.y dp L.dp d.gd L.d.gd) lr_options(ardl) cr(d.y dp d.gd) cr_lags(3) fullsample ``` -------------------------------- ### Estimate ECM/PMG Model with Nodivide Option Source: https://github.com/janditzen/xtdcce2/blob/master/README.md Estimates an ECM/PMG model, recalculating long-run coefficients. The 'nodivide' option within 'lr_options()' is used to estimate equation (7) directly. ```stata xtdcce2 d.c d.pi d.y if year >= 1962 , lr(L.c pi y) p(L.c pi y) nocross lr_options(nodivide) ``` -------------------------------- ### Cross-Section Augmented Distributed Lag (CS-DL) - ARDL(1,3,3) Source: https://github.com/janditzen/xtdcce2/wiki/Home Estimates a CS-DL model for an ARDL(1,3,3) specification. Lags of first differences are included using 'L(0/2).'. 'cr_lags' specifies lag structures, and 'fullsample' is used for specific results. ```stata xtdcce2 d.y dp d.gd L(0/2).d.(dp d.gd), cr(d.y dp d.gd) cr_lags(0 3 3) fullsample ``` -------------------------------- ### Estimate CCE Model with Pooled Coefficients and Constant Source: https://github.com/janditzen/xtdcce2/blob/master/README.md Estimates a dynamic CCE model where specific coefficients and the constant term are pooled across units. This is achieved using the 'pooled' and 'pooledconstant' options. ```stata xtdcce2 d.log_rgdpo L.log_rgdpo log_hc log_ck log_ngd , reportc cr(log_rgdpo log_hc log_ck log_ngd) pooled(L.log_rgdpo log_hc log_ck log_ngd) cr_lags(3) pooledconstant ``` -------------------------------- ### Create Range Plot with estat Source: https://github.com/janditzen/xtdcce2/blob/master/README.md Use 'estat rcap' to generate a range plot. Options 'individual()' and 'combine()' are available for customization. ```stata estat rcap _varlist_ {ifin} [,combine(_string_) individual(_string_) nomg cleargraph] ``` -------------------------------- ### Estimate CCE Model with Instrumental Variables Source: https://github.com/janditzen/xtdcce2/blob/master/README.md Estimates a dynamic CCE model using instrumental variables, specifying endogenous and exogenous variables. Additional 'ivreg2' options like 'nocollin' and 'noid' can be passed through. ```stata xtdcce2 d.log_rgdpo L.log_rgdpo log_hc log_ck log_ngd (log_ck = L.log_ck), reportc cr(log_rgdpo log_hc log_ck log_ngd) cr_lags(3) ivreg2options(nocollin noid) ``` -------------------------------- ### Estimate Mean Group Growth Equation without Explicit Constant Reporting Source: https://github.com/janditzen/xtdcce2/wiki/Home Estimates a growth equation using the mean group approach without explicitly reporting the constant. The constant is partialled out and included in the overall estimation. ```stata xtdcce2 d.log_rgdpo L.log_rgdpo log_hc log_ck log_ngd , nocross. ``` -------------------------------- ### Error Correction Model (Pooled Mean Group Estimator) - Basic Source: https://github.com/janditzen/xtdcce2/wiki/Home Estimates an Error Correction Model using the pooled mean group estimator. Variables for the long-run cointegration vector are defined in 'lr()'. Ensure homogeneity by including corresponding variables in 'p()'. ```stata xtdcce2 d.c d.pi d.y if year >= 1962 , lr(L.c pi y) p(L.c pi y) cr(_all) cr_lags(2) ``` -------------------------------- ### Cross-Section Augmented Distributed Lag (CS-DL) - ARDL(1,1,1) Source: https://github.com/janditzen/xtdcce2/wiki/Home Estimates a CS-DL model for an ARDL(1,1,1) specification. 'cr_lags' uses a numlist to define lag structures for different variables. 'fullsample' is used to reproduce specific results. ```stata xtdcce2 d.y dp d.gd d.(dp d.gd), cr(d.y dp d.gd) cr_lags(0 3 3) fullsample ``` -------------------------------- ### Cross-Section Augmented Distributed Lag (CS-DL) Model Equation Source: https://github.com/janditzen/xtdcce2/blob/master/README.md This equation represents a general ARDL(py,px) model estimated using the CS-DL approach. It directly estimates long-run effects and includes cross-sectional averages and differences of explanatory variables. ```mathematica (8) y(i,t) = w0(i) + x(i,t) * w2(i) + sum(l=1,px) delta(i,l) * (x(i,t-l) - x(i,t-l-1)) + sum [d(i)*z(i,s)] + e(i,t) ``` -------------------------------- ### General Factor Model Specification Source: https://github.com/janditzen/xtdcce2/blob/master/README.md This code block illustrates the general factor model used in panel data analysis, where a variable depends on unobserved common factors and a cross-sectionally independent error term. It assumes both the time dimension (T) and the number of cross-sectional units (N) increase to infinity. ```mathematica x(i,t) = sum(j=1,m) b(j,i) f(j,t) + u(i,t) i = 1,...,N and t = 1,...,T ``` -------------------------------- ### CS-ARDL Long Run Coefficients Formula Source: https://github.com/janditzen/xtdcce2/blob/master/README.md Formulas for calculating long-run coefficients in a CS-ARDL model. These are derived after estimating short-run coefficients. ```mathematica (9) y(i,t) = b0(i) + sum(l=1,py) b1(i,l) y(i,t-l) + sum(l=0,px) b2(i,l) x(i,t-l) + sum [d(i)*z(i,s)] + e(i,t), ``` ```mathematica (10) w2(i) = sum(l=0,px) b2(i,l) / ( 1 - sum(l=1,py) b1(i,l)) ``` ```mathematica (11) w1(i) = 1 - sum(l=1,py) b1(i,l). ``` -------------------------------- ### Estimate Growth Equation with Cross-Sectional Dependence Source: https://github.com/janditzen/xtdcce2/blob/master/README.md Estimate a growth equation using xtdcce2, including cross-sectional averages (cr) of specified variables. After estimation, use xtcse2 with the 'res' option to check for residual cross-sectional dependence. ```Stata xtdcce2 log_rgdpo L.log_rgdpo log_ck log_ngd log_hc , cr(log_rgdpo log_ck log_ngd log_hc) . xtcse2, res ``` -------------------------------- ### Common Correlated Effects (xtdcce2 default) Source: https://github.com/janditzen/xtdcce2/wiki/Home Estimates the Common Correlated Effects model by default, including cross-sectional averages. Use when unobserved common factors between units need to be accounted for. ```Stata xtdcce2, crosssectional(depvar indepvars) cr_lags(0) ``` -------------------------------- ### Predict Partialled Out Variables from CCE Model Source: https://github.com/janditzen/xtdcce2/blob/master/README.md Predicts the partialled out variables from a CCE model estimation using the 'partial' option. Regressing on these variables should yield similar results to the original estimation. ```stata predict partial, partial ``` -------------------------------- ### Error Correction Model (ECM/PMG) ARDL Transformation Source: https://github.com/janditzen/xtdcce2/blob/master/README.md This equation shows the transformation of an ARDL model for ECM/PMG estimation, differentiating between homogenous long run and heterogeneous short run effects. It is presented without cross-sectional averages for readability. ```mathematica (6)y(i,t) = phi(i)*(y(i,t-1) - w0(i) - x(i,t)*w2(i)) + g1(i)*[y(i,t)-y(i,t-1)] + [x(i,t) - x(i,t-1)] * g2(i) + e(i,t), ``` -------------------------------- ### Estimate Static Common Correlated Effects Model with Specified Cross-Sectional Variables Source: https://github.com/janditzen/xtdcce2/wiki/Home Estimates a static common correlated effects model by explicitly defining the variables to be used as cross-sectional averages. This is equivalent to using 'cr(_all)' when all variables are specified. ```stata xtdcce2 d.log_rgdpo log_hc log_ck log_ngd , reportc cr(d.log_rgdpo log_hc log_ck log_ngd). ``` -------------------------------- ### Exponent Estimation in Residuals Source: https://github.com/janditzen/xtdcce2/blob/master/README.md This formula estimates the exponent alpha in residuals using significant pair-wise correlations, as proposed by BKP (2019). It requires a vector of ones and a matrix of significant pair-wise correlations. ```mathematica alpha = ln(tau' delta tau) / [2 ln(N)] ``` -------------------------------- ### Predict Partialled Out Values Source: https://github.com/janditzen/xtdcce2/wiki/Home Creates new variables containing the partialled out values. ```stata predict partial_var, partial ``` -------------------------------- ### Variance of Mean Group Coefficient b1(mg) Source: https://github.com/janditzen/xtdcce2/blob/master/README.md Formula for estimating the variance of the mean group coefficient b1(mg) in a dynamic panel data model. This is used in the Mean Group Estimator. ```mathematica var(b(mg)) = 1/N sum(i=1,N) (b1(i) - b1(mg))^2 ``` -------------------------------- ### Predict Coefficients from CCE Model Source: https://github.com/janditzen/xtdcce2/blob/master/README.md Predicts the unit-specific coefficients from a CCE model estimation using the 'coefficients' option. The mean of these coefficients should match the mean group estimate. ```stata predict coeff, coefficients ``` ```stata sum coeff_log_hc. ``` -------------------------------- ### Predict cfresiduals calculation Source: https://github.com/janditzen/xtdcce2/blob/master/README.md Shows how to calculate residuals including common factors (u(i,t)) using the 'cfresiduals' option. Note that if a constant is used in xtdcce2, it will be included in u(i,t) unless reported using the 'reportconstant' option. ```stata predict _newvar_ , cfresiduals ``` -------------------------------- ### Estimate Static Common Correlated Effects Model with Zero Cross-Sectional Lags Source: https://github.com/janditzen/xtdcce2/wiki/Home Estimates a static common correlated effects model with explicitly set zero cross-sectional lags, meaning only contemporaneous cross-sectional averages are used. This is equivalent to the default behavior. ```stata xtdcce2 d.log_rgdpo log_hc log_ck log_ngd , reportc cr(d.log_rgdpo log_hc log_ck log_ngd) cr_lags(0). ``` -------------------------------- ### CD Test Statistic Formula (Balanced Panel) Source: https://github.com/janditzen/xtdcce2/blob/master/README.md This formula represents the CD test statistic for a balanced panel, summing pairwise correlation coefficients. ```text CD = [2*T / (N*(N-1))]^(1/2) * sum(i=1,N-1) sum(j=i+1,N) rho(ij), ``` -------------------------------- ### Empirical Model Equation (2) Source: https://github.com/janditzen/xtdcce2/blob/master/README.md The empirical model derived from equation (1), excluding the lag of variable x and including cross-sectional means. This is a general form supported by `xtdcce2`. ```mathematica y(i,t) = b0(i) + b1(i)*y(i,t-1) + x(i,t)*b2(i) + sum[d(i)*z(i,s)] + e(i,t) ``` -------------------------------- ### Error Correction Model (ECM/PMG) Equation Source: https://github.com/janditzen/xtdcce2/blob/master/README.md This equation represents a version of the ECM/PMG model estimated by xtdcce2 using OLS. It includes long-run variables specified with 'lr(_varlist_)' and 'pooled(_varlist_)', and first differences as independent variables. ```mathematica (7) y(i,t) = o0(i) + phi(i)*y(i,t-1) + x(i,t)*o2(i) + g1(i)*[y(i,t)-y(i,t-1)] + [x(i,t) - x(i,t-1)] * g2(i) + e(i,t), ``` -------------------------------- ### Predict Residuals from CCE Model Source: https://github.com/janditzen/xtdcce2/blob/master/README.md Predicts the residuals (e(i,t)) from a CCE model estimation using the 'residuals' option. These residuals do not include the partialled out factors. ```stata predict residuals, residuals ``` -------------------------------- ### Asymptotic Distribution of CD Test Statistic Source: https://github.com/janditzen/xtdcce2/blob/master/README.md Under the null hypothesis, the CD test statistic is asymptotically normally distributed with a mean of 0 and a variance of 1. ```text CD ~ N(0,1) ``` -------------------------------- ### Estimate ECM/PMG Model with Long-Run Variables Source: https://github.com/janditzen/xtdcce2/blob/master/README.md Estimates an Error Correction Model (ECM) or Panel Mean Group (PMG) model by defining long-run cointegration vector variables. Ensures homogeneity of long-run effects by including variables in the 'pooled' option. ```stata xtdcce2 d.c d.pi d.y if year >= 1962 , lr(L.c pi y) p(L.c pi y) nocross ``` -------------------------------- ### Variance of Mean Group Coefficients pi(mg) Source: https://github.com/janditzen/xtdcce2/blob/master/README.md Formula for estimating the variance of the mean group coefficients pi(mg), which includes intercept and slope coefficients. This is used in the Mean Group Estimator. ```mathematica var(pi(mg)) = 1/N sum(i=1,N) (pi(i) - pi(mg))(p(i)-pi(mg))' ``` -------------------------------- ### Predict Coefficients Source: https://github.com/janditzen/xtdcce2/wiki/Home Creates a variable containing the estimated cross-section specific values for all coefficients. The name of the new variable is newvar_varname. ```stata predict newvar_varname, coefficients ``` -------------------------------- ### Predict Residuals with Common Factors Source: https://github.com/janditzen/xtdcce2/wiki/Home Use this option to calculate residuals that include common factors, approximated by cross-sectional averages. This is equivalent to calculating u(i,t) = g(i)*f(g) + e(i,t). ```stata predict newvar , residuals ``` -------------------------------- ### Estimate Cross-Sectional Dependence Exponent Source: https://github.com/janditzen/xtdcce2/blob/master/README.md Use xtcse2 to estimate the exponent of cross-sectional dependence for regression variables. This is typically run before the main xtdcce2 estimation. ```Stata xtcse2 d.log_rgdpo L.log_rgdpo log_hc log_ck log_ngd. ``` -------------------------------- ### Estimate Static Common Correlated Effects Model Source: https://github.com/janditzen/xtdcce2/wiki/Home Estimates a static common correlated effects model using all cross-sectional averages. The 'cr(_all)' option includes all independent and dependent variables as cross-sectional averages. ```stata xtdcce2 d.log_rgdpo log_hc log_ck log_ngd , cr(_all) reportc. ```