surf.ls               package:spatial               R Documentation

_F_i_t_s _a _T_r_e_n_d _S_u_r_f_a_c_e _b_y _L_e_a_s_t-_s_q_u_a_r_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     Fits a trend surface by least-squares.

_U_s_a_g_e:

     surf.ls(np, x, y, z)

_A_r_g_u_m_e_n_t_s:

      np: degree of polynomial surface 

       x: x coordinates or a data frame with columns 'x', 'y', 'z' 

       y: y coordinates 

       z: z coordinates. Will supersede 'x$z' 

_V_a_l_u_e:

     list with components

    beta: the coefficients 

       x: 

       y: 

       z: and others for internal use only. 

_R_e_f_e_r_e_n_c_e_s:

     Ripley, B. D. (1981) _Spatial Statistics._ Wiley.

     Venables, W. N. and Ripley, B. D. (2002) _Modern Applied
     Statistics with S._ Fourth edition.  Springer.

_S_e_e _A_l_s_o:

     'trmat', 'surf.gls'

_E_x_a_m_p_l_e_s:

     library(MASS)  # for eqscplot
     data(topo, package="MASS")
     topo.kr <- surf.ls(2, topo)
     trsurf <- trmat(topo.kr, 0, 6.5, 0, 6.5, 50)
     eqscplot(trsurf, type = "n")
     contour(trsurf, add = TRUE)
     points(topo)

     eqscplot(trsurf, type = "n")
     contour(trsurf, add = TRUE)
     plot(topo.kr, add = TRUE)
     title(xlab= "Circle radius proportional to Cook's influence statistic")

