stdize              package:pls              R Documentation(latin1)

_S_t_a_n_d_a_r_d_i_z_a_t_i_o_n _o_f _D_a_t_a _M_a_t_r_i_c_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     Performs standardization (centering and scaling) of a data matrix.

_U_s_a_g_e:

     stdize(x, center = TRUE, scale = TRUE)
     ## S3 method for class 'stdized':
     predict(object, newdata, ...)
     ## S3 method for class 'stdized':
     makepredictcall(var, call)

_A_r_g_u_m_e_n_t_s:

x, newdata: numeric matrices.  The data to standardize.

  center: logical value or numeric vector of length equal to the number
          of coloumns of 'x'.

   scale: logical value or numeric vector of length equal to the number
          of coloumns of 'x'.

  object: an object inheriting from class '"stdized"', normally the
          result of a call to 'stdize'.

     var: A variable.

    call: The term in the formula, as a call.

     ...: other arguments.  Currently ignored.

_D_e_t_a_i_l_s:

     'makepredictcall.stdized' is an internal utility function; it is
     not meant for interactive use.  See 'makepredictcall' for details.

     If 'center' is 'TRUE', 'x' is centered by subtracting the coloumn
     mean from each coloumn.  If 'center' is a numeric vector, it is
     used in place of the coloumn means.

     If 'scale' is 'TRUE', 'x' is scaled by dividing each coloumn by
     its sample standard deviation.  If 'scale' is a numeric vector, it
     is used in place of the standard deviations.

_V_a_l_u_e:

     Both 'stdize' and 'predict.stdized' return a scaled and/or
     centered matrix, with attributes '"stdized:center"' and/or
     '"stdized:scale"' the vector used for centering and/or scaling.
     The matrix is given class 'c("stdized", "matrix")'.

_N_o_t_e:

     'stdize' is very similar to 'scale'.  The difference is that when
     'scale = TRUE', 'stdize' divides the coloumns by their standard
     deviation, while 'scale' uses the root-mean-square of the
     coloumns.  If 'center' is 'TRUE', this is equivalent, but in
     general it is not.

_A_u_t_h_o_r(_s):

     Bjrn-Helge Mevik and Ron Wehrens

_S_e_e _A_l_s_o:

     'mvr', 'pcr', 'plsr', 'msc', 'scale'

_E_x_a_m_p_l_e_s:

     data(yarn)
     ## Direct standardization:
     Ztrain <- stdize(yarn$NIR[yarn$train,])
     Ztest <- predict(Ztrain, yarn$NIR[!yarn$train,])

     ## Used in formula:
     mod <- plsr(density ~ stdize(NIR), ncomp = 6, data = yarn[yarn$train,])
     pred <- predict(mod, newdata = yarn[!yarn$train,]) # Automatically standardized

