[R] Specify model with polynomial interaction terms up to degree n
ruipbarradas at sapo.pt
Sun Jul 8 11:52:49 CEST 2012
Em 08-07-2012 03:00, Peter Ehlers escreveu:
> On 2012-07-07 14:56, YTP wrote:
>> Hi Rui,
>> Thanks for responding. I did not write "raw=raw", and I'm not sure why R
>> would return such a misleading error message. Indeed, the same error
>> comes up when I run the 2nd part of your code:
>>> m <- matrix(1:6, ncol=2)
>>> p6 <- poly(m, degree=6, raw=TRUE)
>> Error in poly(dots[[1L]], degree, raw = raw) :
>> 'degree' must be less than number of unique points
> Are you sure that you submitted the poly() exactly as
> you show above? I can get your error with raw=FALSE or
> NULL or NA or 0 but not with raw=TRUE (or any nonzero
> This is with R version 2.15.1 Patched (2012-06-27 r59661).
> Peter Ehlers
It works with me too.
This has some days already, but I remember the error message and that I
had tested it before posting the code above.
R version 2.15.0 (2012-03-30)
Platform: i386-pc-mingw32/i386 (32-bit)
 LC_MONETARY=Portuguese_Portugal.1252 LC_NUMERIC=C
attached base packages:
 stats graphics grDevices utils datasets methods base
>> However I can think of a workaround for this, and I get the main idea
>> your example, which does exactly what I was hoping for, thanks very much!
>> View this message in context:
>> Sent from the R help mailing list archive at Nabble.com.
>> R-help at r-project.org mailing list
>> PLEASE do read the posting guide
>> and provide commented, minimal, self-contained, reproducible code.
> R-help at r-project.org mailing list
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help