xtpsse.ado - Help file
Marinho Bertanha
Version: 03/11/2014
I'd appreciate your feedback: bertanha@stanford.edu
'xtpsse' runs a conditional fixed-effects Poisson Panel Regression,
computes sandwich and spatial SE, and tests for time-invariant spatial
dependence according to Bertanha and Moser (2014)
DATA:
You need to have a panel dataset with one dependent count data variable and explanatory variables,
besides coordinate information on how cross-section units are located in the R^2 space.
You also need a cross section ID variable and a time variable for your panel. You may either specify the panel using
the 'xtset ' command before you run xtpsse, or your can specify these directly through the i() and t() options.
SYNTAX
xtpsse varlist(numeric) [if] [in], COORDinates(varlist) CUToffs(numlist >0) [I(varname num) T(varname num) TEst(integer)]
where the capital letters indicate how you can abbreviate option names
varlist: (required) enter the list of variables you want to regress, starting by the dependent variable.
You can use abbreviation rules like time_dum* or class1-class20, but only variables that contain numeric values are allowed.
Variables that are constant across time are not allowed.
[if] or [in]: (optional) use them, like in any other STATA command, to restrict the sample you wanna obtain your estimates from.
coordinates(varlist) or coord(varlist): (required) enter the two variable names that contain the coordinates.
E.g. you could have coordx and coordy as variables names. The coordinate variables should
contain numeric real values only, and they should be non-missing for all (i,t) observations used in the regression.
cutoffs(numlist) or cut(numlist): (required) max. distance along each coordinate (x,y) that defines neighborhood of a
cross-sectional unit; this is used to compute the spatial SE estimates; cross-sectional units are located on R^2 space,
so an example of cutoff would be cut(100.5 123). Cutoffs should be strictly positive.
i(varname) : (optional if you use xtset before xtpsse) specify which variable identify cross-section units in your panel.
You either specify it through this option OR using xtset command, before you run xtpsse.
Either way, you DO need to specify both a cross-section and time index variables before you run xtpsse.
t(varname) : (optional if you use xtset before xtpsse) specify which variable identify time units in your panel.
You either specify it through this option OR using xtset command, before you run xtpsse.
Either way, you DO need to specify both a cross-section and time index variables before you run xtpsse.
test(integer) or te(integer): (optional) integer should be between 0 to K, where K is the number of explanatory variables,
if option test is not inputted, the default value for this option is test(K); if option test is inputted with integer=0,
the code does not compute the test-statistic; if integer>0, the code does compute the test-statistic, and will use at most
the first 'integer' elements of the score vector to construct the test-statistic. If 'integer' is too large compared
to N, the Gamma or Omega matrices may be singular. In this case, the code will automatically reduce the number of score
elements being used in order to have invertible Omega and Gamma. The number of spatial lags (used to calculate averages
of spatially lagged score functions) is fixed at the 'cutoff' values; the cutoff value for computing the spatial
covariance matrix of the estimated vector of coefficients 'Theta' is fixed at twice the value
of 'cutoff'; if integer>0,
Examples:
1) xtset cross_id year
xtpsse y x1-x50 age* if year<2000, coord(xcoord ycoord) cut(1000 2000)
2) xtpsse y x1-x50 age* if year<2000, coord(xcoord ycoord) cut(1000 2000) i(cross_id) t(year)
3) xtpsse y x1-x50 age* if year<2000, coord(xcoord ycoord) cut(1000 2000) i(cross_id) t(year) te(0)
4) xtpsse y x1 x2 x3, coord(xcoord ycoord) cut(1000 2000) i(cross_id) t(year) te(3)
has the same effect as
xtpsse y x1 x2 x3, coord(xcoord ycoord) cut(1000 2000) i(cross_id) t(year)