boxcox                 package:MASS                 R Documentation

_B_o_x-_C_o_x _T_r_a_n_s_f_o_r_m_a_t_i_o_n_s _f_o_r _L_i_n_e_a_r _M_o_d_e_l_s

_D_e_s_c_r_i_p_t_i_o_n:

     Computes and optionally plots profile log-likelihoods for the
     parameter of the Box-Cox simple power transformation 'y^lambda'.

_U_s_a_g_e:

     boxcox(object, ...)

     ## Default S3 method:
     boxcox(object, lambda = seq(-2, 2, 1/10), plotit = TRUE,
            interp, eps = 1/50, xlab = "lambda", ylab = "log-Likelihood", ...)

     ## S3 method for class 'formula':
     boxcox(object, lambda = seq(-2, 2, 1/10), plotit = TRUE,
            interp, eps = 1/50, xlab = "lambda", ylab = "log-Likelihood", ...)

     ## S3 method for class 'lm':
     boxcox(object, lambda = seq(-2, 2, 1/10), plotit = TRUE,
            interp, eps = 1/50, xlab = "lambda", ylab = "log-Likelihood", ...)

_A_r_g_u_m_e_n_t_s:

  object: a formula or fitted model object.  Currently only 'lm' and
          'aov' objects are handled. 

  lambda: vector of values of 'lambda' - default (-2, 2) in steps of
          0.1 

  plotit: logical which controls whether the result should be plotted. 

  interp: logical which controls whether spline interpolation is used.
          Default to 'true' if plotting with 'lambda' of length less
          than 100. 

     eps: Tolerance for 'lambda = 0'; defaults to 0.02 

    xlab: defaults to '"lambda"' 

    ylab: defaults to '"log-Likelihood"' 

     ...: additional parameters to be used in the model fitting. 

_V_a_l_u_e:

     A list of the 'lambda' vector and the computed profile
     log-likelihood vector, invisibly if the result is plotted.

_S_i_d_e _E_f_f_e_c_t_s:

     If 'plotit = TRUE' plots loglik _vs_ 'lambda' and indicates a 95%
     confidence interval about the maximum observed value of 'lambda'.
     If 'interp = TRUE', spline interpolation is used to give a
     smoother plot.

_R_e_f_e_r_e_n_c_e_s:

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

_E_x_a_m_p_l_e_s:

     data(trees)
     boxcox(Volume ~ log(Height) + log(Girth), data = trees,
            lambda = seq(-0.25, 0.25, length = 10))

     boxcox(Days+1 ~ Eth*Sex*Age*Lrn, data = quine,
            lambda = seq(-0.05, 0.45, len = 20))

