Skip to content
Prev 31392 / 398506 Next

polynomial fitting

On 29 Apr 2003, Suchandra Thapa wrote:

            
They lie on a line in the x-y plane, so there is collinearity in the fit
and you cannot fit a 2-dimensional trend surface uniquely.
It is not fully correct, as there is scaling of the data going on before 
fitting the polynomial.
You can use the R function poly() to fit orthogonal polynomials using lm
(provided you have genuinely two-dimensional data).
Coefficients:
              (Intercept)  poly(x, y, degree = 2)1.0  
                   827.07                     -20.54  
poly(x, y, degree = 2)2.0  poly(x, y, degree = 2)0.1  
                   167.27                    -337.40  
poly(x, y, degree = 2)1.1  poly(x, y, degree = 2)0.2  
                    67.26                      20.13  


Reminder: spatial is part of the VR bundle, whose DESCRIPTION file says it
is software to support a book.  It is not intended to be comprehensive,
just sufficient for the techniques covered in that book.  I have never
seen a real application of trend surfaces of degree more than 6.