terms2order: Second Order Terms of a Formula

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/regr.R

Description

Create all square and interaction terms of a given formula

Usage

1
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

1
2
3
  data(d.blast)
  t.r <- regr(log10(tremor)~location+log10(distance)+log10(charge), data=d.blast)
  terms2order(t.r)

regr0 documentation built on May 31, 2017, 2:26 a.m.