Valentin Verdier, "Estimation of Dynamic Panel Data Models with Cross-Sectional Dependence: Using Cluster Dependence for Efficiency", Journal of Applied Econometrics, Vol. 31, No. 1, 2016, pp. 85-105. DATA The data set used for this paper is an exact duplicate of the data set used in "Do value added models add value? Accounting for learning dynamics" by Tahir Andrabi, Jishnu Das, Asim Khwaja, and Tristan Zajonc, published in AEJ: Applied Micro in 2011, which can be found at: https://www.aeaweb.org/articles.php?doi=10.1257/app.3.3.29 There is only one data file, which is named finalchildren_long.csv in comma separated format and finalchildren_long.dta in Stata format. The file in either format occupies less than 8MB. childcode is a unique student id. A unique school id can be obtained by grouping the two variables child_schoolid and child_mauzaid. round is the variable indicating the time at which the observation was collected. The other variables have self-explanatory names. The file finalchildren_long.csv is zipped in data-vv-ascii.zip, and the file finalchildren_long.dta is zipped in data-vv-stata.zip. Linux/Unix users should use "unzip -a" for the former, but not the latter. ESTIMATION Two Stata do files are zipped in applic-progs-vv.zip. They are ASCII files in DOS format. Unix/Linux users should use "unzip -a". private_school.do will generate the results presented in Table 5 of the paper. compute_estimates.do is called by private_school.do. The code is provided "as is", and I would be happy to link on my website any suggestions to make the code more concise, efficient, flexible, or, even better, link nicer versions of the estimator already coded up. The results can be read off the log files generated, where phiop, Vopt, phiAB, VAB are listed for each subject. The square root of the estimated variance of the estimators should be taken to obtain standard errors as in Table 5. MONTE CARLO SIMULATIONS -- SPATIAL DEPENDENCE The file mv-spatial-vv.zip contains the code used to generate Table 3 and Figure 1 in the paper. All files are ASCII files in DOS format. Unix/Linux users should use "unzip -a". As with the code for the empirical application, the code is provided "as is", and I would be glad to link any improvement to it on my website. These simulations were performed on a Unix computing server using Stata 13.1. As with the code for cluster dependence, run.sh submits Bootstrap.qsub for different values of the parameters, and Bootstrap.qsub starts Bootstrap.do several times simultaneously and sequentially, so that the simulations can run in parallel and so that each job takes less than 4 hours (the limit on the server I was using). The location where to send error files should be changed in Bootstrap.qsub, and the global root should be changed in Bootstrap.do. Once the all the simulations wanted have finished running, Results_Processing.do computes the quantities of interest (bias, sd, rmse) and stores them in Results.dta. Then MakeTable.do makes Table 3 in the paper. LocationGraphs.do makes Figure 1 in the paper. MONTE CARLO SIMULATIONS -- CLUSTER DEPENDENCE The file mc-cluster-vv.zip contains a large number of files in several folders. The ASCII files are in Unix format, *not* DOS format, and there are some binary files. These files provide the code used to generate Table 1 and 2 in the paper and all of the tables in the appendix. As with the code for the empirical application, the code is provided "as is", and I would be glad to link any improvement to it on my website. These simulations were performed on a Unix computing server using Stata 13.1. run.sh submits Bootstrap.qsub for different values of the parameters, and Bootstrap.qsub starts Bootstrap.do several times simultaneously and sequentially, so that the simulations can run in parallel and so that each job takes less than 4 hours (the limit on the server I was using). The location where to send error files should be changed in Bootstrap.qsub, and the global root should be changed in Bootstrap.do. The files are set up to generate the results in Table 1 and 2 of the paper only, but the results in the other tables in the appendix can be replicated as well by changing the values of the inputs in run.sh and Bootstrap.qsub. (Change run.sh to include more values of n, T, ng, change Bootstrap.qsub to run less iterations if only want 1,000 replications to save computing time.) Bootstrap.do does not need to be changed. Once the all the simulations wanted have finished running, Results_Processing.do computes the quantities of interest (bias, sd, rmse, coverage of 95% confidence interval etc...) and stores them in Results.dta. It is set-up to process the results only for Tables 1 and 2, but other results can be processed as well by changing the lists of inputs at the beginning of the file. Then MakeTable2.do makes Table 1 and Table 2 in the paper. MakeTable.do makes all of the tables in the appendix, but only if you ran the simulations for those values of the parameters as well. Weights: For the third scenario in the paper, one needs to compute the optimal weights for the unfeasible optimal estimator by simulations. The analytical form of the weights can not easily be derived. I provide the simulated matrices necessary to compute these optimal weights for ng=5 (which is enough for Tables 1 and 2 in the paper and one third of the tables in the appendix), but if one wants to compute the unfeasible optimal estimator for the third scenario for other values of ng, one should also compute the necessary optimal weights by running runWmatrix.sh and ProcessWMatrix.sh found in Weights/Code.