Object Reference : Object View and Procedure Reference : Equation
  
Equation
 
abtest
arch
archtest
ardl
arma
auto
binary
boundstest
breakls
breakspec
breaktest
cdtest
cellipse
censored
chow
cinterval
clearhist
coefcov
coefscale
coint
cointgraph
cointreg
cointrep
correl
correlsq
count
cvardecomp
depfreq
derivs
display
displayname
effects
endogtest
equation
facbreak
fit
fixedtest
forecast
garch
glm
gmm
Basic GMM Options
Estimation Weighting Matrix Options
Covariance Options
grads
heckit
hettest
hist
icgraph
ictable
infbetas
infstats
instsum
label
liml
logit
ls
lvageplot
makecoint
makederivs
makegarch
makegrads
makelimits
makemodel
makeregs
makeresids
makergmprobs
makestrwgts
maketransprobs
means
midas
multibreak
olepush
ordered
orthogtest
output
predict
probit
qreg
qrprocess
qrslope
qrsymm
ranhaus
rcomptest
representations
reset
resids
results
rgmprobs
rls
robustls
setattr
stepls
strconstant
strlinear
strnonlin
strwgts
switchreg
testadd
testdrop
testfit
threshold
transprobs
tsls
ubreak
updatecoefs
varinf
wald
weakinst
white
Equation object. Equations are used for single equation estimation, testing, and forecasting.
Equation Declaration
equation declare equation object.
To declare an equation object, enter the keyword equation, followed by a name:
equation eq01
and an optional specification:
equation r4cst.ls r c r(-1) div
equation wcd.ls q=c(1)*n^c(2)*k^c(3)
Equation Methods
arch autoregressive conditional heteroskedasticity (ARCH and GARCH).
ardl least squares with autoregressive distributed lags .
binary binary dependent variable models (includes probit, logit, gompit) models.
breakls least squares with breakpoints and breakpoint determination
censored censored and truncated regression (includes tobit) models.
cointreg cointegrating regression using FMOLS, CCR, or DOLS, or panel FMOLS or DOLS.
count count data modeling (includes poisson, negative binomial and quasi-maximum likelihood count models).
glm estimate a Generalized Linear Model (GLM).
gmm estimate an equation using generalized method of moments (GMM).
heckit estimate a selection equation using the Heckman ML or 2-step method.
liml estimate an equation using Limited Information Maximum Likelihood and K-class estimation.
logit logit (binary) estimation.
ls estimation using least squares or nonlinear least squares.
midas Mixed Data Sampling (MIDAS) regression.
ordered ordinal dependent variable models (includes ordered probit, ordered logit, and ordered extreme value models).
probit probit (binary) estimation.
qreg estimate an equation using quantile regression.
robustls robust regression (M-estimation, S-estimation and MM-estimation).
stepls estimate an equation using stepwise regression.
switchreg exogenous and Markov switching regression .
threshold threshold least squares, including threshold autoregression .
tsls estimate an equation using two-stage least squares regression.
Equation Views
abtest test for serial correlation in a panel GMM equation using the Arellano-Bond test.
archtest LM test for the presence of ARCH in the residuals.
arma Examine ARMA structure of estimated equation.
auto Breusch-Godfrey serial correlation Lagrange Multiplier (LM) test.
boundstest perform the Pesaran, Shin and Smith (2001) bounds test of long-run relationships from an ARDL estimated equation.
breakspec display the breakpoint specification for an equation estimated by least squares with breakpoints .
breaktest perform breakpoint test for TSLS and GMM equations.
cdtest test for the presence of cross-sectional dependence of errors in panel equations.
cellipse confidence ellipses for coefficient restrictions.
chow Chow breakpoint and forecast tests for structural change.
cinterval confidence interval for coefficients.
coefcov coefficient covariance matrix.
coefscale scaled coefficients.
coint test for cointegration between series in an equation estimated using cointreg.
cointgraph view a graph of the estimated cointegrating relation form of an ARDL estimated equation.
cointrep view the estimated cointegration form and the long-run coefficients table of an ARDL estimated equation.
correl correlogram of the residuals.
correlsq correlogram of the squared residuals.
cvardecomp coefficient covariance decomposition table.
depfreq display frequency and cumulative frequency table for the dependent variable.
derivs derivatives of the equation specification.
display display table, graph, or spool in object window.
effects display table of estimated fixed and/or random effects.
endogtest perform the regressor endogeneity test.
facbreak factor breakpoint test for stability.
fixedtest test significance of estimates of fixed effects for panel estimators.
garch conditional standard deviation graph (only for equations estimated using ARCH).
grads examine the gradients of the objective function.
hettest test for heteroskedasticity.
hist histogram and descriptive statistics of the residuals.
icgraph display a graph of the selection criteria for the top 20 models observed as part of model selection during estimation.
ictable display a table of the log-likelihood and selection criteria for the top 20 models observed as part of model selection during estimation.
infbetas scaled difference in estimated betas for influence statistics.
infstats influence statistics.
instsum show a summary of the equation instruments.
label label information for the equation.
lvageplot leverage plot.
means descriptive statistics by category of the dependent variable (only for binary, ordered, censored and count equations).
multibreak perform multiple breakpoint testing for an equation specified by list and estimated by least squares.
orthogtest perform the instrument orthogonality test.
output table of estimation results.
predict prediction (fit) evaluation table (only for binary and ordered equations).
qrprocess display table or graph of quantile process estimates.
qrslope test of equality of slope coefficients across multiple quantile regression estimates.
qrsymm test of coefficients using symmetric quantiles.
ranhaus Hausman test for correlation between random effects and regressors.
rcomptest tests for the presence of cross-sectional or time random components in a panel equation. estimated using pooled least squares.
representations text showing specification of the equation.
reset Ramsey’s RESET test for functional form.
resids display, in tabular form, the actual and fitted values for the dependent variable, along with the residuals.
results table of estimation results.
rgmprobs display the regime probabilities in a switching regression equation .
rls recursive residuals least squares (only for non-panel equations estimated by ordinary least squares, without ARMA terms).
strconstant tests for constancy of the base specification coefficients against a smoothly varying alternative in a smooth threshold regression strlinear compute tests for linearity of the base specification against the smooth threshold alternative in a smooth threshold regression strnonlin compute various tests for additional additive or encapsulated nonlinearity in a smooth threshold regression strwgts compute and display the transition weights in a smooth threshold regression .
testadd likelihood ratio test for adding variables to equation.
testdrop likelihood ratio test for dropping variables from equation.
testfit performs Hosmer and Lemeshow and Andrews goodness-of-fit tests (only for equations estimated using binary).
transprobs display the state transition probabilities in a switching regression equation.
ubreak Andrews-Quandt test for unknown breakpoint.
varinf display Variance Inflation Factors (VIFs).
wald Wald test for coefficient restrictions.
weakinst display the weak instruments summary.
white White test for heteroskedasticity.
Equation Procs
clearhist clear the contents of the history attribute.
displayname set display name.
fit static forecast.
forecast dynamic forecast.
makecoint Create a series containing the estimated cointegrating relationship from an ARDL estimated equation.
makederivs make group containing derivatives of the equation specification.
makegarch create conditional variance series (only for ARCH equations).
makegrads make group containing gradients of the objective function.
makelimits create vector of estimated limit points (only for ordered models).
makemodel create model from estimated equation.
makeregs make group containing the regressors.
makergmprobs save the regime probabilities in a switching regression equation.
makeresids make series containing residuals from equation.
makestrwgts save the smooth transition weights in a smooth threshold regression .
maketransprobs save the state transition probabilities in a switching regression equation.
olepush push updates to OLE linked objects in open applications .
setattr set the value of an object attribute .
updatecoefs update coefficient vector(s) from equation.
Equation Data Members
Scalar Values
@aic Akaike information criterion.
@bylist returns 1 or 0 depending on whether the equation was estimated by list.
@coefcov(i,j) covariance of coefficient estimates i and j.
@coefs(i) i-th coefficient value.
@deviance deviance (for Generalized Linear Models)
@deviancestat deviance statistic: deviance divided by degrees-of-freedom (for Generalized Linear Models).
@df degrees-of-freedom for equation.
@dispersion estimate of dispersion (for Generalized Linear Models)
@dw Durbin-Watson statistic.
@f F-statistic.
@fixeddisp indicator for whether the dispersion is a fixed value (for Generalized Linear Models).
@fprob probability value of the F-statistic.
@hacbw bandwidth for HAC estimation of GMM weighting matrix or long-run covariance in cointegrating regression (if applicable).
@hq Hannan-Quinn information criterion.
@instrank rank of instruments (if applicable).
@jstat J-statistic — value of the GMM objective function (for GMM and TSLS).
@jprob probability value of the J-statistic
@limlk estimate of LIML (if applicable).
@logl value of the log likelihood function.
@lrprob probability value of likelihood ratio statistic (if applicable).
@lrstat likelihood ratio statistic (if applicable).
@lrvar long-run variance estimate for cointegrating regression (if applicable).
@meandep mean of the dependent variable.
@ncases number of cases.
@ncoef number of estimated coefficients.
@ncross number of cross-sections used in estimation (equal to 1 for non-panel workfiles).
@npers number of workfile periods used in estimation (same as @regobs for non-panel workfiles).
@nregimes number of regimes in a switching and breakpoint regression.
@objective quasi-likelihood objective function (if applicable).
@pearsonssr Pearson sum-of-squared residuals (for Generalized Linear Models).
@pearsonstat Pearson statistic: Pearson SSR divided by degrees-of-freedom (for Generalized Linear Models).
@pval(i) i-th coefficient p-value
@qlrprob probability value of quasi-likelihood ratio statistic (if applicable).
@qlrstat quasi-likelihood ratio statistic (if applicable).
@quantdep quantile of dependent variable (for quantile regression).
@r2 R-squared statistic.
@rbar2 adjusted R-squared statistic.
@rdeviance restricted (constant only) deviance (for Generalized Linear Models).
@regobs number of observations in regression.
@rlogl restricted (constant only) log-likelihood (if applicable).
@robf robust F-statistic (Wald-test form).
@robfprob robust F-statistic (Wald-test form) p-value.
@robjective restricted (constant only) quasi-likelihood objective function (if applicable).
@schwarz Schwarz information criterion.
@sddep standard deviation of the dependent variable.
@se standard error of the regression.
@sparsity estimate of sparsity (for quantile regression).
@ssr sum of squared residuals.
@stderrs(i) standard error for coefficient i.
@thresholds number of thresholds (for threshold regression).
@tstats(i) t-statistic or z-statistic value for coefficient i.
@wmeandep weighted mean of dependent variable (if applicable).
@wgtscale scaling factor for weights (if applicable).
c(i) i-th element of default coefficient vector for equation (if applicable).
Vectors and Matrices
@ardlcoint returns a coef containing coefficients from the cointegrating relationship form of an ARDL estimation.
@ardllrcoefs returns a coef containing coefficients from the long run relationship form of a non-panel ARDL estimation.
@ardlsrcoefs .returns a matrix where each row corresponds to an individual cross-section’s short-run coefficients. Only applicable for PMG/ARDL estimation.
@ardlsrses .returns a matrix where each row corresponds to an individual cross-section’s short-run coefficient standard errors. Only applicable for PMG/ARDL estimation.
@coefcov covariance matrix for coefficient estimates.
@coefs coefficient vector.
@cointcov symmetric matrix containing the contemporaneous covariance for cointegrating regression equations.
@effects vector of fixed and random effects estimates (if applicable).
@initprobs matrix containing initial probabilities for switching regression equations.
@instwgt symmetric matrix containing the final sample instrument weighting matrix used during GMM or TSLS estimation (e.g., for 2SLS and for White weighting).
@lambda2cov symmetric matrix containing the portion of one-sided long run variances for cointegrating regression equations.
@pvals vector containing the coefficient probability values.
@stderrs vector of standard errors for coefficients.
@thresholds vector of threshold values (for threshold estimation).
@tstats vector of t-statistic or z-statistic values for coefficients.
String Values
@ardlcointsubst returns string representation of the cointegration form of an ARDL equation with substituted coefficients.
@attr(“arg”) string containing the value of the arg attribute, where the argument is specified as a quoted string.
@breaks string containing the breakpoint dates.
@coeflabels coefficient labels used in regression output table.
@coeflist returns a string containing a space delimited list of the coefficients used in estimation (e.g., “C(1) C(2) C(3)”). This function always returns the list of actual coefficients used, irrespective of whether the original equation was specified by list or by expression.
@command full command line form of the estimation command. Note this is a combination of @method, @options and @spec.
@description string containing the Equation object’s description (if available).
@detailedtype returns a string with the object type: “EQUATION”.
@displayname returns the equation’s display name. If the equation has no display name set, the name is returned.
@esteq returns string representation of the estimation equation.
@extralist space delimited list of the equation's extra regressors. For equation's estimated by ARCH, @extralist contains the variance equation terms. For equations estimated by CENSORED, this contains the error distribution terms. For all other equation methods it returns an empty string.
@instlist space delimited list of the equation instruments (if applicable).
@method command line form of estimation method (“ARCH”, “LS”, etc....).
@name returns the name of the Equation.
@options command line form of estimation options.
@smpl description of the sample used for estimation.
@spec original equation specification. Note this will be different from @varlist if the equation specification contains groups, or is specified by expression.
@subst returns string representation of the equation with substituted coefficients.
@type returns a string with the object type: “EQUATION”.
@units string containing the Equation object’s units description (if available).
@updatetime returns a string representation of the time and date at which the equation was last updated.
@varlist space delimited list of the equation’s dependent variable and regressors if the equation was specified by list, or the equation’s underlying variables (both dependent and independent) if the equation was specified by expression.
Equation Examples
To apply an estimation method (proc) to an existing equation object:
equation ifunc
ifunc.ls r c r(-1) div
To declare and estimate an equation in one step, combine the two commands:
equation value.tsls log(p) c d(x) @ x(-1) x(-2)
equation drive.logit ifdr c owncar dist income
equation countmod.count patents c rdd
To estimate equations by list, using ordinary and two-stage least squares:
equation ordinary.ls log(p) c d(x)
equation twostage.tsls log(p) c d(x) @ x(-1) x(-2)
You can create and use other coefficient vectors:
coef(10) a
coef(10) b
equation eq01.ls y=c(10)+b(5)*y(-1)+a(7)*inc
The fitted values from EQ01 may be saved using,
series fit = eq01.@coefs(1) + eq01.@coefs(2)*y(‑1) + eq01.@coefs(3)*inc
or by issuing the command:
eq01.fit fitted_vals
To perform a Wald test:
eq01.wald a(7)=exp(b(5))
You can save the t-statistics and covariance matrix for your parameter estimates:
vector eqstats=eq01.@tstats
matrix eqcov=eq01.@coefcov