terms2order {regr}R Documentation

Second Order Terms of a Formula

Description

Create all square and interaction terms of a given formula

Usage

terms2order(object, squared = TRUE, interactions = TRUE)

Arguments

object

An object for which formula(object) returns a formula. Usually a regression fit

squared

logical: Should square terms be added to the interactions?

interactions

logical: Should interaction terms be added?

Details

The 'squares' are the squares of the terms of dataClass 'numeric' appearing in the formula (cf. attr(object$terms, "dataClass"), except for terms that are already squares (contain ^). Analogously for interactions: they combine all terms that do not contain :.

Value

'term.labels' of the generated terms

Author(s)

Werner A. Stahel, ETH Zurich

See Also

add1.regr

Examples

  data(d.blast, package="plgraphics")
  t.r <- regr(log10(tremor)~location+log10(distance)+log10(charge), data=d.blast)
  terms2order(t.r)

[Package regr version 1.1 Index]