e------------------------------------------------------------------------------ help for ^boxcox2^ ------------------------------------------------------------------------------- Box Cox Regression Models ------------------------- ^boxcox2^ depvar [indepvars] [weight] [^if^ exp] [^in^ range ] [^,^ ^model^(^lhs^only |^rhs^only | ^lam^bda | ^theta^) ^notr^ans(^varlist^) ^l^evel(^#^) ^lrtest^ ^from^(^init_specs^) ^noc^onstant ^nolog^ ^nologlr^ ] ^fweight^s, and ^iweight^s are allowed ; see help weights. ^boxcox2^ shares the features of all estimation commands; see help @est@ The syntax for predict after ^boxcox2^ is ^predict^ [type] newvarname [^if^ exp] [^in^ range] [ ^yhat^ | ^xbt^ | ^res^iduals ] Description ---------- ^boxcox2^ finds the maximum likelihood estimates of the parameter[s] 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. Note: this command estimates a superset of the models accommodated by the ^boxcox^ command of official Stata. See ^[R] boxcox^ for information on the official command. The Box-Cox transform of a variable y is given by L (L) y - 1 y = ------- L where y must be strictly positive. Options ------- ^model^( ^lhs^only | ^rhs^only | ^lam^bda | ^theta^ ) specifies which of the four models to fit. ^model(lhsonly)^ applies the Box-Cox transform to ^depvar^ only. model(lhsonly) is the default value. ^model(rhsonly)^ causes the transform to be applied to the ^indepvars^ only. ^model(lambda)^ causes the transform to be aplied to both ^depvar^ and ^indepvars^, and they are transformed by the same parameter. ^model(theta)^ causes the transform to be aplied to both ^depvar^ and ^indepvars^, but this time each side is tranformed by a separate parameter. ^notrans^(^varlist^) specifies that the variables in ^varlist^ are to be included as non-transformed independent variables. ^lrtest^ specifies that a likelihood ratio test is to be performed and reported for each independent variable. ^from()^ allows the user to specify the initial values for Box-Cox transformation parameter(s). Model Initial value specification ------------------------------------------- ^lhsonly^ from( #_t, copy) ^rhsonly^ from( #_l, copy) ^lambda^ from( #_l, copy) ^theta^ from( #_l #_t, copy) ------------------------------------------- where #_l is the intial value of lambda and #_t is the initial value of theta. ^noconstant^ suppresses the constant term (intercept) in the model. ^nolog^ suppresses the iteration log when estimating the full model. ^nologlr^ suppresses the iteration log when estimating the restricted models required by the ^lrtest^ option. If ^nologlr^ is specified when ^lrtest^ is not, then it is ignored. ^level^(^#^)} specifies the confidence level, in percent, for confidence intervals. The default is ^level(95)^ or as set by ^set^ ^level^; see 23.5 Specifying the width of confidence intervals. Options for predict ------------------- ^xbt^ the default, calculates the transformed linear prediction. ^yhat^ calculates the predicted value of y. ^residuals^ calculates the residuals left over after the predicted value of y has been subtracted from the actual value. Examples -------- . ^boxcox2 mpg weight price, notrans(foreign) model(theta) lrtest ^ . ^boxcox2 mpg weight price, model(lambda) lrtest^ . ^boxcox2 mpg weight price, notrans(foreign) model(rhs)^ . ^boxcox2 mpg weight price, notrans(foreign) model(lhsonly) lrtest^ Also see -------- Manual: ^[U] 23 Estimation and post-estimation commands^, ^[U] 29 Overview of model estimation in Stata^, ^[R] boxcox^ ^[R] lnskew0^ On-line: help for ^est^, ^lincom^, ^lnskew0^, ^postest^, ^predict^, ^regress^, ^test^, ^testnl^