[R] Specify model with polynomial interaction terms up to degree n
YTP
cprice at gmail.com
Tue Jul 3 00:52:45 CEST 2012
I think you have taken my toy example seriously. Perhaps I wasn't clear, but
I am in fact not working with a dataset of 3 observations of the numbers 1
through 6 and trying to estimate anything; that was an example to illustrate
what I am asking for, namely, turning two variables like this
X1 X2
1 4
2 5
3 6
into a dataset like this
1 4 16
4 10 25
9 18 36
where each column is the interaction between certain polynomial terms of the
original variables, such that each column has a sum of exponents equal to 2
(or whatever degree n is desired). My apologies if I wasn't clear, any other
ideas would be appreciated. It appears the poly command you mentioned is
only taking powers of a single vector.
--
View this message in context: http://r.789695.n4.nabble.com/Specify-model-with-polynomial-interaction-terms-up-to-degree-n-tp4635130p4635217.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list