# econometrics.it

Federico Belotti's niche on the web

## Spatial panel data models using Stata

A new command for estimating and forecasting spatial panel data models using Stata is now available: xsmle.

xsmle fits fixed or random effects spatial models for balanced panel data. See the mi prefix command in order to use xsmle in the unbalanced case. Consider the following general specification for the spatial panel data model:




where  is a normally distributed error term,  is the spatial matrix for the autoregressive component,  the spatial matrix for the spatially lagged independent variables,  the spatial matrix for the idiosyncratic error component.  is the individual fixed or random effect and  is the time effect. xsmle fits the following nested models:

i) The SAR model with lagged dependent variable ()

,

where the standard SAR model is obtained by setting .

ii) The SDM model with lagged dependent variable ()

,

where the standard SDM model is obtained by setting . xsmle allows to use a different weighting matrix for the spatially lagged dependent variable () and the spatially lagged regressors () together with a different sets of explanatory () and spatially lagged regressors (). The default is to use  and .

iii) The SAC model ()

,
,

for which xsmle allows to use a different weighting matrix for the spatially lagged dependent variable () and the error term ().

iv) The SEM model ()

,
.

v) The GSPRE model ()

,
,
,

where also the random effects have a spatial autoregressive form.

The command was written together with Andrea Piano Mortari and Gordon Hughes.

You may install it by typing

net install xsmle, all from(http://www.econometrics.it/stata)

HTH,
Federico

## twopm: estimating two-part models using Stata

A new Stata command to estimate two-part models for mixed discrete-continuous outcomes is now available at SSC/econometrics.it.

In two part models, a binary choice model is estimated for the probability of observing a zero versus positive outcome. Then, conditional on a positive outcome, an appropriate regression model is estimated for the positive outcome.

twopm focuses on continuous outcomes modeled using regress or glm. When the outcome is a count variable, such models are known as hurdle models. Of special note is that twopm allows the user to leverage the capabilities of predict and margins to calculate predictions and marginal effects from the combined first- and second-part models.

It was written together with Partha Deb.
You may install the command by typing

ssc install twopm

HTH,
Federico