Next: resid() Up: Regression Macros Help File Previous: regs()   Contents

# removevar()

Usage:
 ```removevar(var1 [,var2 ...] [,silent:T]), var1, var2, ... the names or numbers of independent variables in the current stepwise model ```

Keywords: stepwise regression, regression
```removevar(Var) removes independent variable from the current stepwise
regression model.  Var can be either a quoted name ("z3"), an unquoted
name (z3) or the number of a variable in the current stepwise model (an
'in' variable).  Thus if the full model is "y=x1+x2+x3+x4+x5",
removevar(x2), removevar("x2") and removevar(2) are equivalent.

It is an error if the variable is not an independent variable in the
full stepwise model or if it is not in the current model.

Invisible variable _STEPSTATUS is updated to reflect the changed model.
See topic '_STEPSTATUS'.

The F-to-remove statistics with P-values are printed for all the
variables in the model, and F-to-enter statistics with P-values are
printed for any variables not in the model, including Var.

In addition, if there are any variables left in the model, removevar()
prints an overall F statistic and its P-value, Mallow's Cp statistic,
adjusted R^2 and R^2.  The F-statistic tests the null hypothesis that
the coefficients of the "in" variables are 0.

The value returned is the updated invisible variable _STEPSTATUS.  It
can be assigned (stuff <- removevar(x3)), but is not printed.

removevar(Var1, Var2 ...) does the same except that more than one
variable is removed.  All variable must be in the current stepwise
model.  The model and other statistics are printed after each variable
is removed.  The value returned is _STEPSTATUS after all have been
removed.  An example when the full model is "y=x1+x2+x3+x4+x5"
might be removevar(x1,"x2",4).  This would remove x1, x2 and x4 in that
order.

removevar(Var1 [,Var2 ...], silent:T) does the same, except that the
model and summary statistics are not printed.