Grocer Function

NAME

ols - ordinary least squares

CALLING SEQUENCE

[rols]=ols(grocer_namey,arg1,...,argn)

PARAMETERS

Input

Output

DESCRIPTION

The most general GROCER function performing least-squares regression. Endogenous variable must be given first, as a vector, a ts, between quotes (if the user wants to keep the name of the variable in the tlist result and for the printings) or not. Exogenous variables are given after, in one of the formats authorized for the endogenous one, or in matrix format. The program displays on screen various results (coefficients, tstat, Rē, Durbin and Watson,...) except if the user has entered the argument 'noprint' anywhere after the first argument.

EXAMPLES

1) bounds('1964q3','1989q2'); rols=ols('del(lm1-lp)','del(lp)','del(lagts(1,lm1-lp-ly))','rnet', 'lagts(1,lm1-lp-ly)', 'cte');
2) bounds('1964q3','1989q2'); rols=ols('del(lm1-lp)',['del(lp)','del(lagts(1,lm1-lp-ly))','rnet', 'lagts(1,lm1-lp-ly)','cte']);
3) bounds('1964q3','1989q2'); rols=ols(del(lm1-lp),del(lp),del(lagts(1,lm1-lp-ly)),rnet, lagts(1,lm1-lp-ly),cte);
4) bounds('1964q3','1989q2'); rols=ols(del(lm1-lp),del(lp),del(lagts(1,lm1-lp-ly)),rnet, lagts(1,lm1-lp-ly),cte, 'noprint');
5) y=grand(100,1, 'nor',0,1); x=grand(100,4, 'nor',0,1);ols('y', 'x')
6) ols(y, x);

Examples 1 to 3 provide the same results 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'.
Example 4 gives exactly the same tlist result as example 3, but the results are not displayed on screen (this can be done later by typing prtuniv(rols)).
Examples 5 and 6 give the same results, except that the endogenous variables is named 'y' in example 5 and 'endogenous' in example 6 and the exogenous variables 'x_1', 'x_2', 'x_3', 'x_4' in example 5 and 'exogenous # 1', 'exogenous # 2', 'exogenous # 3', 'exogenous # 4' in example 6.

AUTHOR

Eric Dubois 2002