Skip to content
Prev 299708 / 398503 Next

Specify model with polynomial interaction terms up to degree n

a) Please supply some context in your mail message.  Not everyone reads R-help via nabble.

b) poly(raw=TRUE, x, degree=degree) was changed for 2.15.0 to allow it to output
a non-full-rank matrix.  See the NEWS file in 2.15.0 or after:
  > # in R-2.15.1
  > n <- news()
  > n[grepl("poly", n$Text),]
  Changes in version 2.15.0:  
  
  NEW FEATURES
  
      o   poly(raw = TRUE) no longer requires more unique points than the
          degree.  (Requested by John Fox.)
  ...

c) Error messages include the innermost R function call before the error.  To see more call traceback(),
which will show the call stack from the innermost call back to the call you made:

  > # in R-2.14.1
  > m <- matrix(1:6, ncol=2)
  > poly(m, degree=6, raw=TRUE)
  Error in poly(dots[[1L]], degree, raw = raw) :
    'degree' must be less than number of unique points
  > traceback()
  6: stop("'degree' must be less than number of unique points")
  5: poly(dots[[1L]], degree, raw = raw)
  4: cbind(1, poly(dots[[1L]], degree, raw = raw))
  3: polym(V1 = 1:3, V2 = 4:6, degree = 6, raw = TRUE)
  2: do.call("polym", c(m, degree = degree, raw = raw))
  1: poly(m, degree = 6, raw = TRUE)

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com