*! version 1.0.0 27Jun2026

Title

betark -- Beta regression with AR(k) errors for proportion/rate outcomes, by joint conditional maximum likelihood

Syntax

betark
depvar
[indepvars]
[if] [in]
, lag(#) [options]

Model
* lag(#) set the order of the AR(k) process for the mean equation

scale(varlist) covariates for the precision (scale) equation; default is constant only

noconstant suppress constant term from the mean equation

Reporting
level(#) set confidence level; default is level(95)

coeflegend display legend instead of statistics

nolog suppress the iteration log

Convergence
tolerance(#) convergence criterion; default is tolerance(1e-6)

iterate(#) maximum iterations; default is iterate(1500)

from(matrix) user-supplied starting values, in place of the default static betareg fit

* lag(#) is required.

You must tsset your data before using betark; see tsset.

depvar must be strictly greater than 0 and less than 1.

indepvars is optional; if omitted, an intercept-only mean equation is fitted.

Factor variables and time-series operators are allowed in depvar, indepvars,
and scale(); see fvvarlist and tsvarlist.

Typing betark without arguments replays the last estimation results.

Postestimation syntax

The following predict options are available after betark:

predict newvar [if] [in] [, statistic]

statistic

cmean conditional (AR-adjusted, one-step-ahead) mean of depvar; the default

cvariance conditional (AR-adjusted) variance of depvar

xb linear prediction in the mean equation, without the AR adjustment

xbscale linear prediction in the scale equation

xb and xbscale are available both in and out of sample. cmean and
cvariance require lagged values of depvar and are therefore computed only
where the full AR(k) history is available within a contiguous time segment.

Description

betark fits a beta regression model for a continuous proportion or rate outcome
strictly bounded on (0,1), with autoregressive errors of order k in the mean
equation's linear predictor. betark estimates the mean equation coefficients, the
precision (scale) equation coefficients, and the AR coefficients rho_1,...,rho_k
jointly in a single conditional likelihood. This is possible because the
recursive substitution of Rocha and Cribari-Neto (2009)
and Ferreira, Figueroa-Zuniga, and de Castro (2015) yields a
closed-form conditional beta density at each time period, given the AR(k) history.

Options

Model

lag(#) specifies the order of the AR(k) process in the mean equation and must
be a positive integer; lag() is required.

scale(varlist) specifies covariates for the precision (scale) equation, on the
log scale. If omitted, the scale equation is constant-only (a single estimated
precision parameter phi, as in the default betareg specification).

noconstant suppresses the constant term from the mean equation. The scale
equation always includes a constant in the current version.

Reporting

level(#) specifies the confidence level as a percentage. Default is
level(95).

coeflegend; see [R] Estimation options.

nolog suppresses the iteration log.

Convergence

tolerance(#) specifies the parameter- and value-change convergence criterion.
Default is tolerance(1e-6).

iterate(#) specifies the maximum number of iterations. Default is
iterate(1500), matching betareg's default.

from(matrix) supplies user starting values in place of the default, which is
a static betareg fit (rho = 0) on the same mean and scale specification.

Examples

Set-up

. use betark_example.dta

. tsset t

Fit an AR(1) model

. betark y t _x150 _x_t150, lag(1)

Fit an AR(2) model

. betark y t _x150 _x_t150, lag(2)

Covariates in the scale (precision) equation

. betark y t _x150 _x_t150, lag(2) scale(t)

Suppress the iteration log

. betark y t _x150 _x_t150, lag(2) nolog

Postestimation -- AR-adjusted conditional mean and variance

. betark y t _x150 _x_t150, lag(2)

. predict mu_hat, cmean

. predict var_hat, cvariance

. tsline y mu_hat, xline(150)

Compare to the linear prediction without the AR adjustment

. predict xb_hat, xb

. gen mu_noar = invlogit(xb_hat)

. tsline y mu_hat mu_noar, xline(150)

Stored results

betark stores the following in e():

Scalars

e(N) number of observations (excludes the first k observations of
each segment, used to initialize the AR recursion but not contributing to the
likelihood)

e(df_m) mean-equation model degrees of freedom (excludes scale and AR
parameters)

e(chi2) Wald chi-squared statistic for the mean equation's non-constant
coefficients

e(p) p-value for Wald chi-squared

e(ll) joint conditional log likelihood at the final estimates

e(p_lag) order of the AR process fitted

e(iterations) number of iterations to convergence

e(converged) 1 if the optimizer reported convergence, 0 otherwise

e(ngaps) number of gaps in sample (includes panel changes); the AR
recursion is restarted at each

e(tolerance) convergence tolerance used

Macros

e(cmd) betark

e(cmdline) command as typed

e(title) title in estimation output

e(depvar) name of dependent variable

e(timevar) name of time variable

e(panelvar) name of panel variable (if panel data)

e(link) link function used for the mean equation

e(linkt) title used to label the mean-equation link in the output header

e(slink) link function used for the scale equation

e(slinkt) title used to label the scale-equation link in the output header

e(noconstant) noconstant, if specified

e(predict) betark_p

Matrices

e(b) coefficient vector, with three equation blocks: the mean equation
(named after depvar), scale, and ar (rho_1,...,rho_k)

e(V) variance-covariance matrix of the joint conditional MLE

Functions

e(sample) marks estimation sample

References

Ferrari, S., and F. Cribari-Neto. 2004. Beta regression for modelling rates and
proportions. Journal of Applied Statistics 31(7): 799-815.

Ferreira, G., J. I. Figueroa-Zuniga, and M. de Castro. 2015. Partially linear beta
regression model with autoregressive errors. TEST 24(4): 752-775.

Linden, A. 2026. Beta regression with autoregressive errors for interrupted time
series analysis of proportion and rate outcomes: A simulation study.
Preprint.
https://arxiv.org/abs/2607.07914

Rocha, A. V., and F. Cribari-Neto. 2009. Beta autoregressive moving average models.
TEST 18(3): 529-545.

Author

Ariel Linden

Linden Consulting Group, LLC

alinden@lindenconsulting.org

Citation of betark

betark is not an official Stata command. It is a free contribution
to the research community, like a paper. Please cite it as such:

Linden, Ariel. 2026. Stata module for computing Beta regression with autoregressive-corrected errors for proportion outcomes,
by joint conditional maximum likelihood. Statistical Software Components s459773, Boston College Department of Economics.

Also see

Online: betareg, poissark (if installed),
praisk (if installed), xtpraisk (if installed)