Stata help for boxcox
help boxcox dialog: boxcox also see: boxcox postestimation -------------------------------------------------------------------------------
Title
[R] boxcox -- Box-Cox regression models
Syntax
boxcox depvar [indepvars] [if] [in] [weight] [, options]
options description ------------------------------------------------------------------------- Model noconstant suppress constant term model(lhsonly) left-hand-side Box-Cox model; the default model(rhsonly) right-hand-side Box-Cox model model(lambda) both sides Box-Cox model with same parameter model(theta) both sides Box-Cox model with different parameters notrans(varlist) nontransformed independent variables
Reporting level(#) set confidence level; default is level(95) lrtest perform likelihood-ratio test
Max options nolog suppress full-model iteration log nologlr suppress restricted-model lrtest iteration log maximize_options control the maximization process; seldom used ------------------------------------------------------------------------- depvar and indepvars may contain time-series operators; see tsvarlist. bootstrap, by, jackknife, rolling, statsby, and xi are allowed; see prefix. fweights and iweights are allowed; see weight. See boxcox postestimation for features available after estimation.
Description
boxcox finds the maximum likelihood estimates of the parameters of the Box-Cox transform, the coefficients on the independent variables, and the standard deviation of the normally distributed errors for a model in which depvar is regressed on indepvars. The user has the option of transforming either the depvar, some of the indepvars, both the depvar and some of the indepvars with the same transformation parameter, or both the depvar and some of the indepvars with different transformation parameters. Any transformed variable must be strictly positive.
Options
+-------+ ----+ Model +------------------------------------------------------------
noconstant; see estimation options.
model(lhsonly|rhsonly|lambda|theta) specifies which of the four models to fit.
model(lhsonly) applies the Box-Cox transform to depvar only. model(lhsonly) is the default.
model(rhsonly) applies the transform to the indepvars only.
model(lambda) applies the transform to both depvar and indepvars, and they are transformed by the same parameter.
model(theta) applies the transform to both depvar and indepvars, but this time, each side is transformed by a separate parameter.
notrans(varlist) specifies that the variables in varlist be included as nontransformed independent variables.
+-----------+ ----+ Reporting +--------------------------------------------------------
level(#); see estimation options.
lrtest specifies that a likelihood-ratio test of significance be performed and reported for each independent variable.
+-------------+ ----+ Max options +------------------------------------------------------
nolog suppresses the iteration log when fitting the full model.
nologlr suppresses the iteration log when fitting the restricted models required by the lrtest option.
maximize_options: iterate(#) and from(init_specs); see maximize.
Model Initial value specification --------------------------------------- lhsonly from(#_t, copy) rhsonly from(#_l, copy) lambda from(#_l, copy) theta from(#_l #_t, copy) ---------------------------------------
Examples
. boxcox mpg weight price, notrans(foreign) model(theta) lrtest
. boxcox mpg weight price foreign, model(lhs) lrtest nolog nologlr
. boxcox mpg weight price, model(lambda) lrtest
. boxcox mpg weight price, notrans(foreign) model(rhs)
. boxcox mpg weight price, notrans(foreign) model(lhsonly) lrtest
Also see
Manual: [R] boxcox
Online: boxcox postestimation; lnskew0, regress