ordinary least squares
[rols]=ols(namey,arg1,...,argn)
* namey = a time series, a real (nx1) vector or a string equal to the name of a time series or a (nx1) real vector between quotes
* argi = arguments which can be:
- a time series
- a real (nx1) vector
- a real (nxk) matrix
- a string equal to the name of a time series or a (nxk) real vector or matrix between quotes
- a list of such elemnts
- the string 'noprint' if the user doesn't want to display the results of the regression
- the string 'saturate(x)' if the user wants to test breaks with impulse indicator saturation at the size x
* rols = a results tlist with
- rols('meth') = '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('aic')= the Akaike information criterion
- rols('bic')= the Schwarz information criterion
- rols('hq')= the Hannan-Quinn information criterion
- 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
- rols('prests') = boolean indicating the presence or absence of a time series in the regression
- rols('namey') = name of the y variable
- rols('namex') = name of the x variables
- rols('bounds') = if there is a timeseries in the regression, the bounds of the regression
load(GROCERDIR+'/data/bdhenderic.dat'); bounds('1964q3','1989q2'); rols=ols('delts(lm1-lp)','delts(lp)','delts(lagts(1,lm1-lp-ly))','rnet', 'lagts(1,lm1-lp-ly)', 'const'); // performs ols for Hendry and Ericsson (1991) equation 6 rols=ols('delts(lm1-lp)',['delts(lp)','delts(lagts(1,lm1-lp-ly))','rnet', 'lagts(1,lm1-lp-ly)','const']); // same results as previous call to ols rols=ols(delts(lm1-lp),delts(lp),delts(lagts(1,lm1-lp-ly)),rnet, lagts(1,lm1-lp-ly),const); // same results as 2 previous calls to ols, except that the third example does not keep the names of the variables, // which are named 'endogenous', 'exogenous # 1', 'exogenous # 2', 'exogenous # 3', 'exogenous # 4', 'exogenous # 5'. rols=ols(delts(lm1-lp),delts(lp),delts(lagts(1,lm1-lp-ly)),rnet, lagts(1,lm1-lp-ly),const, 'noprint'); // same results as 2 first calls to ols, except that the results are not displayed on screen // (this can be done later by typing prtuniv(rols)). y=grand(100,1, 'nor',0,1); x=grand(100,4, 'nor',0,1); ols('y', 'x') ols(y, x); // same results as above, except that the endogenous variables 'endogenous' instead of y and the exogenous variables // 'exogenous # 1', 'exogenous # 2', 'exogenous # 3', 'exogenous # 4' instead of 'x_1', 'x_2', 'x_3', 'x_4'. r=ols('lm1-lp','ly','delts(lp)','rnet','lagts(lm1-lp)','lagts(2,lm1-lp)','lagts(rnet)','saturate(0.01)') // an example with indicator saturation at size 0.01 (1%) | ![]() | ![]() |