Grocer Function
NAME
ols2a - ordinary least squares
CALLING SEQUENCE
[results]=ols2a(y,x ,prescte,results)
PARAMETERS
Input
-
y = dependent variable vector (nobs x 1)
-
x = independent variables matrix (nobs x nvar)
-
prescte = a boolean indicating whether the model contains a cte term or not
-
results = a tlist containing all necessary fields, with the fields 'meth','nobs','y','namey','prests', 'ym' are already filled
Output
-
results = a tlist with
. results('meth') = 'ols'
. results('y') = y data vector
. results('x') = x data matrix
. results('nobs') = nobs
. results('nvar') = nvars
. results('beta') = bhat
. results('yhat') = yhat
. results('resid') = residuals
. results('vcovar') = estimated variance-covariance matrix of beta
. results('sige') = estimated variance of the residuals
. results('sige') = estimated variance of the residuals
. results('ser') = standard error of the regression
. results('tstat') = t-stats
. results('pvalue') = pvalue of the betas
. results('dw') = Durbin-Watson Statistic
. results('condindex') = multicolinearity cond index
. results('prescte') = boolean indicating the presence or absence of a constant in the regression
. results('rsqr') = rsquared
. results('rbar') = rbar-squared
. results('f') = F-stat for the nullity of coefficients other than the constant
. results('pvaluef') = its significance level
DESCRIPTION
One of the numerous functions performing ordinary least squares: this one assumes that x et y are already a matrix and a vector respectively, that the existence or absence of a constant has already been determined (and stored in a boolean) and that a result tlist exists which can be filled.
EXAMPLE
1) r1_00=ols2a(grocer_y,grocer_x,prescte,lrmod(2))
This example is taken from automatic.
AUTHOR
Eric Dubois 2002