Next: removevar() Up: Regression Macros Help File Previous: regresshelp()   Contents

# regs()

Usage:
 ```regs(x,y [,T] [GLM keywords]), x and y REAL matrices with the same number of rows; T means no intercept ```

Keywords: glm, regression
```regs(x,y) computes the regression of y on the columns of x.  For
example, when data is a n by 7 matrix, say, you can compute the
regression of the last column on the first 6 by regs(data[,-7],
data[,7]).

regs(x,y,T) does the same, except the model fit has no constant term
(intercept).

You can use GLM keyword phrases such as 'pvals:T', 'silent:T',
'wts:weights', and 'marginal:T' as additional arguments.

Macro regs() creates temporary variables @X1, @X2, ... and @Y and then
invokes regress() or, if y has more than 1 column, manova().

When y is univariate, immediately follow regs() by anova() to see the
ANOVA table.  When y is multivariate, follow regs() by regcoefs() to see
coefficients and standard errors.

Because the model for regress() or manova() uses temporary variables,
STRMODEL cannot be used as a model for a subsequent regress(), anova(),
or manova() command.  However, these variables can be retrieved, by
modelvars().   For example, when x has 3 columns,

Cmd> makecols(modelvars(x:T),X1,X2,X2)

creates variables X1, X2 and X3.  Of course, if x still exists,
makecols(x,X1,X2,X3) does the same.