*! version 1.0 13may2016

Title

gb2reg -- Regression with a GB2 Error Term

Syntax

gb2reg
depvar
indepvars
[if]
[in]
[, options]

Main
qinfinite use the generalized gamma distribution

lnormal use the lognormal distribution

sigma variable list used in the sigma equation

p variable list used in the p equation

p variable list used in the q equation

initial initial values for the coefficients (optional and must be equal to the number of regressors plus the number of free parameters)

constraints(numlist) constraints by number to be applied

maximize_options control the
maximization process

Description

gb2reg fits a model of the log of depvar on indepvars using maximum likelihood with an error term distributed as a gb2. The parameter delta varies with the independent variables.
The other parameters can also vary with the independent variables
if the sigma(), p(), and q() options are used. All values of the dependent
variable must be positive.

Options

Main

qinfinite specifies that the distribution that should be used should be the limit of the gb2 as the parameter q becomes arbitrarily large (i.e. the generalized gamma distribution, which has three free parameters).

lnormal specifies that the lognormal distribution should be used (two free parameters).

sigma specifies the variables to be used in the sigma equation.

p specifies the variables to be used in the p equation (not valid if using option lnormal).

q specifies the variables to be used in the q equation (not valid if using option lnormal or qinfinite).

initial list of numbers that specifies the initial values of the coefficients. This is optional, the program will attempt to search for the best initial values if no initial values are provided.

vce(vcetype) specifies the type of standard error reported, which includes
types that are robust to some kinds of misspecification (robust), that
allow for intragroup correlation (cluster clustvar), and that are
derived from asymptotic theory (oim, opg); see [R] vce_option.

constraints(numlist)
specifies the linear constraints to be
applied during estimation. constraints(numlist) specifies the
constraints by number. Constraints are defined using the constraint
command; see [R] constraint.

maximize_options:
difficult,
technique(algorithm_spec),
iterate(#),
[no]log,
trace,
gradient,
showstep,
hessian,
showtolerance,
tolerance(#),
ltolerance(#),
nrtolerance(#); see [R] maximize. Allowed techniques include Newton-Raphson (nr), Berndt-Hall-Hausman (bhhh), Davidon
-Fletcher-Powell (dfp), and Broyden-Fletcher-Goldfarb-Shanno (bfgs). The default
algorithm is Newton-Raphson.

Remarks

In cases where the convergence is difficult, try to use the option technique(bfgs), or the other two technique options. technique(bfgs) is often more robust than the default technique(nr).

Examples

. clear

. set obs 1000

. set seed 5678

. gen x1 = rnormal(0,1)

. gen x2 = runiform()

. gen y = 1 + 2*x1 + 3*x2 + rnormal(0,1)

. gb2reg y x1 x2

. gb2reg y x1 x2, vce(robust)

. gb2reg y x1 x2, technique(bfgs)

. gb2reg y x1 x2, qinf

. gb2reg y x1 x2, sigma(x2) p(x2) qinf

. gb2reg y x1 x2, sigma(x2) ln

. constraint define 1 [p]_cons=2

. gb2reg y x1 x2, const(1) qinf