*! version 1.0.5 Stephen P. Jenkins & Fernando Rios-Avila April 2026

Bivariate mixed Poisson regression, post-estimation

bimpoisson postestimation -- Postestimation tools for bimpoisson

Postestimation commands

The following postestimation commands are available after bimpoisson:

Command Description

predict predictions

Syntax for predict

predict
[type]
newvar
[if] [in]
[, statistic nooffset] [options]

statistic

xb1 linear prediction for equation 1

xb2 linear prediction for equation 2

stdp1 standard error of the linear prediction for equation 1

stdp2 standard error of the linear prediction for equation 2

n1 count prediction for equation 1

n2 count prediction for equation 2

pr1(#) predicted prob(outcome 1 = #); # is integer-valued

pr2(#) predicted prob(outcome 2 = #); # is integer-valued

pr12(#1 #2) predicted prob(outcome 1 = #1, outcome 2 = #2);
#1, #2 are integer-valued

Note: pr1, pr2, and pr12, are derived by simulation; the options below are
relevant in this case.

options

nsim(#) sets number of simulations used to calculate predicted
probabilities

seed(#) sets the random seed used when calculating predicted
probabilities. (If not set, defaults to current rng state.)

Description for predict

predict creates a new variable containing predictions such as counts,
linear predictions, and predicted probabilities.

For each observation, and outcome equation j = 1, 2, the linear prediction
is xj'bj, where xj and bj are vectors of explanatory
variables (including a constant term) and estimated coefficients, respectively.

The predicted count for outcome j is

lambda_j = E(yj|xj) = exp(xj'bj + (sigma_j^2)/2 )

where sigma_j is the estimated standard deviation of the normal mixture
distribution for outcome equation j. Thus the predicted count is the
marginal predicted derived by integrating out the random effect. The
lambda_j can be used to calculate marginal effects: see Jumamyradov
and Munkin (2025, p. 67).

The formulae for the predicted probabilities are taken from Munkin and Trivedi
(1999, pp. 43 and 46). Predicted probabilities are calculated by simulation using
uniform pseudorandom draws from normal distributions. For a univariate count
probability, the normal distribution has mean zero and standard deviation
set equal to the fitted standard deviation. For a joint count probability, the
normal distribution has mean zero and standard deviations set equal to the
fitted standard deviations and correlation equal to the fitted correlation.

Options for predict

xb1 calculates the linear prediction for equation 1. Use exp(xb1_hat) to
calculate mean conditional on a random effect.

xb2 calculates the linear prediction for equation 2. Use exp(xb2_hat) to
calculate mean conditional on a random effect.

stdp1 calculates the standard error of the linear prediction of
equation 1

stdp2 calculates the standard error of the linear prediction of
equation 2

n1 calculates the predicted count for equation 1 (with random effect
integrated out)

n2 calculates the predicted count for equation 2 (with random effect
integrated out)

pr1(#) calculates the predicted prob(outcome 1 = #) using simulation

pr2(#) calculates the predicted prob(outcome 2 = #) using simulation

pr12(#1 #2) calculates the predicted prob(outcome 1 = #1, outcome 2 = #2)
using simulation

nsim(#) sets the number of simulations used to calculate predicted
probabilities (default # = 100)

seed(#) sets the seed (affects calculations of predicted probabilities).
If not set, defaults to current rng state.

nooffset is relevant only if you specified offset1(varname) or
offset2(varname) for bimpoisson. It modifies the calculations made
by predict so that they ignore the offset variables; the linear
predictions are treated as xb rather than as xb + offset1 and z_[gamma] rather
than as z_[gamma] + offset2.

Examples

* Setup (see also bimpoisson Examples)

use "rwm1984.dta", clear

correlate docvis hospvis

generate byte postHS = edlevel1 == 0

generate byte MarM = (married == 1 & female == 0)

generate byte MarF = (married == 1 & female == 1)

generate byte SinM = (married == 0 & female == 0)

generate byte SinF = (married == 0 & female == 1)

global xvars MarM SinM SinF kids outwork postHS

* Fit model in stages

bimpoisson (docvis = ) ( hospvis = ), seed(111)

matrix b0 = e(b)

bimpoisson (docvis = $xvars) ( hospvis = $xvars), ///

seed(4321) from(b0) nsim(250) antithetic bias rho_sf(`e(rho)')

* Get predictions

predict xb1, xb1

predict xb2, xb2

predict n1, n1

predict n2, n2

predict pr10, pr1(0) // Pr(outcome 1 = 0)

predict pr20, pr2(0) // Pr(outcome 2 = 0)

predict pr11, pr1(1) // Pr(outcome 1 = 1)

predict pr21, pr2(1) // Pr(outcome 2 = 1)

predict pr12, pr1(2) // Pr(outcome 1 = 2)

predict pr22, pr2(2) // Pr(outcome 2 = 2)

predict pr12_00, pr12(0 0) // Pr(outcome 1 = 0 & outcome 2 = 0)

predict pr12_21, pr12(2 1) // Pr(outcome 1 = 2 & outcome 2 = 1)

Authors

Stephen P. Jenkins <s.jenkins@lse.ac.uk>

London School of Economics and Political Science (LSE)

Fernando Rios-Avila <f.rios.a@gmail.com>

London School of Economics and Political Science (LSE)

References

Jumamyradov, M. and Munkin, M. K. 2022. Biases in maximum simulated
likelihood estimation of bivariate models. Journal of Econometric Methods
11, 55-70. https://doi.org/10.1515/jem-2021-0003

Munkin, M. K. and Trivedi, P. K. 1999. Simulated maximum likelihood estimation
of multivariate mixed-Poisson regression models, with application.
The Econometrics Journal 2, 29-48.
https://doi.org/10.1111/1368-423X.00019

Also see

Help: bimpoisson (if installed)