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 power transformation.

_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 = expression(lambda),
            ylab = "log-Likelihood", ...)

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

     ## S3 method for class 'lm':
     boxcox(object, lambda = seq(-2, 2, 1/10), plotit = TRUE,
            interp, eps = 1/50, xlab = expression(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))

