constrained ordinary least squares
rols=ols2_cons(y,x,R,r)
* y = dependent variable vector (nobs x 1)
* x = independent variables matrix (nobs x nvar)
* R = a (nc x k) matrix
* r = a (nc x 1) vector
* rols = a results tlist with
- rols('meth') = 'constrained ols'
- rols('y') = y data vector
- rols('x') = x data matrix
- rols('nobs') = # observations
- rols('nvar') = # variables
- rols('beta') = bhat
- rols('yhat') = yhat
- rols('resid') = residuals
- rols('vcovar') = estimated variance-covariance matrix of beta
- rols('sige') = estimated variance of the residuals
- rols('sigu') = sum of squared residuals
- rols('ser') = standard error of the regression
- rols('tstat') = t-stats
- rols('pvalue') = pvalue of the betas
- rols('dw') = Durbin-Watson Statistic
- rols('condindex') = multicolinearity cond index
- rols('prescte') = boolean indicating the presence or absence of a constant in the regression
- rols('llike') = the log-likelihood
- rols('R') = the R matrix in Rb=r
- rols('r') = the r matrix in Rb=r
- rols('rsqr') = rsquared
- rols('rbar') = rbar-squared
- rols('f') = F-stat for the nullity of coefficients other than the constant
- rols('pvaluef') = its significance level
load(GROCERDIR+'/macros/grocer/db/bdhenderic.dat') ; bounds('1964q3','1989q2') ;[y,junk,x]=explouniv('delts(lm1-lp)',['delts(lp)','delts(lagts(1,lm1))',... 'delts(lagts(1,lp))','delts(lagts(1,ly))','rnet','lagts(1,lm1-lp-ly)','cte']);r=ols2_cons(y,x,[0 1 1 0 0 0 0 ; 0 1 0 1 0 0 0],[0;0]) // The example shows the estimation of Hendry and Ericsson (1991) model by imposing the constraints on // delts(lagts(1,lm1)), 'delts(lagts(1,lp))' and 'delts(lagts(1,ly))' in order to obtain delts(lagts(1,lm1-ly-lp)) // (see help for ols_cons). Estimation results are stored in tlist r. | ![]() | ![]() |