Overview MCMC algorithms used for simulating posterior distributions are indispensable tools in Bayesian analysis. A major consideration in MCMC simulations is that of convergence. Has the simulated Markov chain fully explored the target posterior distribution so far, or do we need longer simulations? A common approach in assessing MCMC convergence is based on running and […]
↧
Gelman–Rubin convergence diagnostic using multiple chains
↧
Tests of forecast accuracy and forecast encompassing
\(\newcommand{\mub}{{\boldsymbol{\mu}}} \newcommand{\eb}{{\boldsymbol{e}}} \newcommand{\betab}{\boldsymbol{\beta}}\)Applied time-series researchers often want to compare the accuracy of a pair of competing forecasts. A popular statistic for forecast comparison is the mean squared forecast error (MSFE), a smaller value of which implies a better forecast. However, a formal test, such as Diebold and Mariano (1995), distinguishes whether the superiority of one […]
↧
↧
Multiple equation models: Estimation and marginal effects using gsem
Starting point: A hurdle model with multiple hurdles In a sequence of posts, we are going to illustrate how to obtain correct standard errors and marginal effects for models with multiple steps. Our inspiration for this post is an old Statalist inquiry about how to obtain marginal effects for a hurdle model with more than […]
↧
Multiple equation models: Estimation and marginal effects using mlexp
We continue with the series of posts where we illustrate how to obtain correct standard errors and marginal effects for models with multiple steps. In this post, we estimate the marginal effects and standard errors for a hurdle model with two hurdles and a lognormal outcome using mlexp. mlexp allows us to estimate parameters for […]
↧
Unit-root tests in Stata
\(\newcommand{\mub}{{\boldsymbol{\mu}}} \newcommand{\eb}{{\boldsymbol{e}}} \newcommand{\betab}{\boldsymbol{\beta}}\)Determining the stationarity of a time series is a key step before embarking on any analysis. The statistical properties of most estimators in time series rely on the data being (weakly) stationary. Loosely speaking, a weakly stationary process is characterized by a time-invariant mean, variance, and autocovariance. In most observed series, however, the […]
↧
↧
Flexible discrete choice modeling using a multinomial probit model, part 1
\(\newcommand{\xb}{{\bf x}} \newcommand{\betab}{\boldsymbol{\beta}} \newcommand{\zb}{{\bf z}} \newcommand{\gammab}{\boldsymbol{\gamma}}\)We have no choice but to choose We make choices every day, and often these choices are made among a finite number of potential alternatives. For example, do we take the car or ride a bike to get to work? Will we have dinner at home or eat out, and […]
↧
Flexible discrete choice modeling using a multinomial probit model, part 2
Overview In the first part of this post, I discussed the multinomial probit model from a random utility model perspective. In this part, we will have a closer look at how to interpret our estimation results. How do we interpret our estimation results? We created a fictitious dataset of individuals who were presented a set […]
↧
Effects of nonlinear models with interactions of discrete and continuous variables: Estimating, graphing, and interpreting
I want to estimate, graph, and interpret the effects of nonlinear models with interactions of continuous and discrete variables. The results I am after are not trivial, but obtaining what I want using margins, marginsplot, and factor-variable notation is straightforward. Do not create dummy variables, interaction terms, or polynomials Suppose I want to use probit […]
↧
Doctors versus policy analysts: Estimating the effect of interest
\(\newcommand{\Eb}{{\bf E}}\)The change in a regression function that results from an everything-else-held-equal change in a covariate defines an effect of a covariate. I am interested in estimating and interpreting effects that are conditional on the covariates and averages of effects that vary over the individuals. I illustrate that these two types of effects answer different […]
↧
↧
Probability differences and odds ratios measure conditional-on-covariate effects and population-parameter effects
\(\newcommand{\Eb}{{\bf E}} \newcommand{\xb}{{\bf x}} \newcommand{\betab}{\boldsymbol{\beta}}\)Differences in conditional probabilities and ratios of odds are two common measures of the effect of a covariate in binary-outcome models. I show how these measures differ in terms of conditional-on-covariate effects versus population-parameter effects. Difference in graduation probabilities I have simulated data on whether a student graduates in 4 years […]
↧
Multiple-equation models: Estimation and marginal effects using gmm
We estimate the average treatment effect (ATE) for an exponential mean model with an endogenous treatment. We have a two-step estimation problem where the first step corresponds to the treatment model and the second to the outcome model. As shown in Using gmm to solve two-step estimation problems, this can be solved with the generalized […]
↧
Vector autoregressions in Stata
Introduction In a univariate autoregression, a stationary time-series variable \(y_t\) can often be modeled as depending on its own lagged values: \begin{align} y_t = \alpha_0 + \alpha_1 y_{t-1} + \alpha_2 y_{t-2} + \dots + \alpha_k y_{t-k} + \varepsilon_t \end{align} When one analyzes multiple time series, the natural extension to the autoregressive model is the vector […]
↧
Exact matching on discrete covariates is the same as regression adjustment
I illustrate that exact matching on discrete covariates and regression adjustment (RA) with fully interacted discrete covariates perform the same nonparametric estimation. Comparing exact matching with RA A well-known example from the causal inference literature estimates the average treatment effect (ATE) of pregnant women smoking on the babies’ birth weights.
↧
↧
Group comparisons in structural equation models: Testing measurement invariance
When fitting almost any model, we may be interested in investigating whether parameters differ across groups such as time periods, age groups, gender, or school attended. In other words, we may wish to perform tests of moderation when the moderator variable is categorical. For regression models, this can be as simple as including group indicators […]
↧
Two faces of misspecification in maximum likelihood: Heteroskedasticity and robust standard errors
For a nonlinear model with heteroskedasticity, a maximum likelihood estimator gives misleading inference and inconsistent marginal effect estimates unless I model the variance. Using a robust estimate of the variance–covariance matrix will not help me obtain correct inference. This differs from the intuition we gain from linear regression. The estimates of the marginal effects in […]
↧
Cointegration or spurious regression?
\(\newcommand{\betab}{\boldsymbol{\beta}}\)Time-series data often appear nonstationary and also tend to comove. A set of nonstationary series that are cointegrated implies existence of a long-run equilibrium relation. If such an equlibrium does not exist, then the apparent comovement is spurious and no meaningful interpretation ensues. Analyzing multiple nonstationary time series that are cointegrated provides useful insights about […]
↧
An ordered-probit inverse probability weighted (IPW) estimator
teffects ipw uses multinomial logit to estimate the weights needed to estimate the potential-outcome means (POMs) from a multivalued treatment. I show how to estimate the POMs when the weights come from an ordered probit model. Moment conditions define the ordered probit estimator and the subsequent weighted average used to estimate the POMs. I use […]
↧
↧
Structural vector autoregression models
\(\def\bfy{{\bf y}} \def\bfA{{\bf A}} \def\bfB{{\bf B}} \def\bfu{{\bf u}} \def\bfI{{\bf I}} \def\bfe{{\bf e}} \def\bfC{{\bf C}} \def\bfsig{{\boldsymbol \Sigma}}\)In my last post, I discusssed estimation of the vector autoregression (VAR) model, \begin{align} \bfy_t &= \bfA_1 \bfy_{t-1} + \dots + \bfA_k \bfy_{t-k} + \bfe_t \tag{1} \label{var1} \\ E(\bfe_t \bfe_t’) &= \bfsig \label{var2}\tag{2} \end{align} where \(\bfy_t\) is a vector of […]
↧
Quantile regression allows covariate effects to differ by quantile
Quantile regression models a quantile of the outcome as a function of covariates. Applied researchers use quantile regressions because they allow the effect of a covariate to differ across conditional quantiles. For example, another year of education may have a large effect on a low conditional quantile of income but a much smaller effect on […]
↧
Estimating covariate effects after gmm
In Stata 14.2, we added the ability to use margins to estimate covariate effects after gmm. In this post, I illustrate how to use margins and marginsplot after gmm to estimate covariate effects for a probit model. Margins are statistics calculated from predictions of a previously fit model at fixed values of some covariates and […]
↧