powtran                 package:alr3                 R Documentation

_P_o_w_e_r _t_r_a_n_s_f_o_r_m_a_t_i_o_n_s

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

     'powtran' computes members of families of transformations indexed
     by one parameter, the Box-Cox power family, or the Yeo and Johnson
     (2000) family, or the basic power family, interpreting zero power
     as logarithmic.  The family can be modified to have Jacobian one,
     or not, except for the basic power family.

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

     powtran(U, lambda,family,modified)

     ## Default S3 method:
     powtran(U, lambda,family="box.cox",modified=TRUE)

     ## S3 method for class 'bctrans':
     powtran(U, lambda=coef(U), family=U$family,modified=FALSE)

     ## S3 method for class 'matrix':
     powtran(U, lambda, family="power",modified=FALSE)

     ## S3 method for class 'data.frame':
     powtran(U, lambda, family="power",modified=FALSE)

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

       U: U can be a vector, a matrix, a data.frame, or an object of
          type bctrans.  Missing values are permitted.  U must  be
          strictly positive unless family="yeo.johnson".

  lambda: The transformation parameter, typically a value between -2
          and 2. For U of type matrix, data.frame, or bctrans, lambda
          must be a vector with the same number of elements as U has
          columns.  lambda has no default, except for objects for type
          bctrans where the default is the value computed by bctrans.

  family: The transformation family to be used. See the details below.

modified: TRUE to divide by the Jacobian, as need to transform the
          response,  FALSE for no division.  The default is TRUE except
          for objects of type bctrans, where the default is FALSE.

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

     The Box-Cox family of _scaled power transformations_,
     'family="box.cox"',  equals (U^(lambda)-1)/lambda  for lambda not
     equal to zero, and  log(U) if lambda = 0.

     If 'family="yeo.johnson"' then the Yeo-Johnson transformations are
     used.   This is is Box-Cox transformation of U+1 for nonnegative
     values,  and of |U|+1 with parameter 2-lambda for U negative.

     The basic power transformation is simply U^lambda  if lambda not
     zero, and log(U) otherwise.

     If 'modified=TRUE', then the scaled transformations are divided by
     the  Jacobian, which is a function of the geometric mean.

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

     For U a vector, matrix or data.frame, returns an object of the
     same type as U of transformed values.  For class bctrans, returns
     an object of the same class and shape as U$X.

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

     Sanford Weisberg, sandy@stat.umn.edu

_R_e_f_e_r_e_n_c_e_s:

     Weisberg, S. (2005).  _Applied Linear Regression_, third edition.
     New York:  Wiley, Chapter 7.

     Yeo, In-Kwon and Johnson, Richard (2000).  A new family of power
     transformations to improve normality or symmetry.  _Biometrika_,
     87, 954-959.

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

     'inv.tran.plot', 'bctrans', 'inv.res.plot','tran.family'.

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

     data(ufcwc)
     attach(ufcwc)
     powtran(Height,lambda=0)
     inv.tran.plot(Dbh,Height, lam = c(-1, 0, 1), family="box.cox")
     summary(ans <- bctrans1(cbind(Dbh,Height))) # bctrans1 is used for a matrix input
     plot(ans)

