varnames(Model [,stripat:T,stripbrack:T]) where Model is CHARACTER scalar containing a GLM model varnames([stripat:T,stripbrack:T]) is equivalent to varnames(STRMODEL [,stripat:T,stripbrack:T]) |

varnames(Model) returns as a CHARACTER vector the name of the response variable followed by the names of the factors and variates in Model in the order they first appear. Model should be a CHARACTER variable or quoted string. Model must contain a legal GLM model, except that variables in the model need not be REAL or even be defined. Variables to evaluated "on the fly" are not evaluated and the expression is returned as the name enclosed in {...}. See topic 'models'. NOTE: This represents a change from earlier versions. Previously varnames(Model) extracted the variable names without checking the validity of the model and did not handle expressions to be evaluated on the fly correctly. varnames(Model, stripbrack:T) does the same, except any names which are expressions are not enclosed in {...}. varnames(Model, stripat:T [,stripbrack:T]) does the same, except any non-expression names which are temporary variables have the leading '@' strippped off. varnames([keyword phrases]) without a model is equivalent to varnames(STRMODEL [,keyword phrases]), returning a vector of the names of the variables in STRMODEL. This is usually the model used by the most recent GLM (generalized linear or linear model) command such as regress(), anova(), or poisson(). Cmd> varnames("{log(y)} = @x + {@x^2}") (1) "{log(y)}" (2) "@x" (3) "{@x^2}" Cmd> varnames("{log(y)} = @x + {@x^2}",stripat:T) (1) "{log(y)}" (2) "x" (3) "{@x^2}" Cmd> varnames("{log(y)} = @x + {@x^2}",stripbrack:T) (1) "log(y)" (2) "@x" (3) "@x^2" Cmd> varnames("{log(y)} = @x + {@x^2}",stripbrack:T,stripat:T) (1) "log(y)" (2) "x" (3) "@x^2" See also topics xvariables(), modelvars(), 'models', compnames(), nameof(), 'glm'.

Gary Oehlert 2003-01-15