lambdaPlot               package:BHH2               R Documentation

_L_a_m_b_d_a _p_l_o_t: _t_r_a_c_e_s _t_h_e _t _a_n_d _F _s_t_a_t_i_s_t_i_c_s _i_n _B_o_x-_C_o_x _t_r_a_n_s_f_o_r_m_a_t_i_o_n _o_f _t_h_e _r_e_s_p_o_n_s_e

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

     Trace regression coefficients' _t_-values or _F_-ratios for
     different values of lambda in the Box-Cox transformation.

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

     lambdaPlot(mod, lambda = seq(-1, 1, by = 0.1), stat = "F", global = TRUE,
         cex = par("cex"), ...)

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

     mod: list. A list of class 'lm'.

  lambda: numeric. The values of lambda in the Box-Cox transformation.
          See *Details*.

    stat: character. Either '"t"' of '"F"', corresponding to the
          coefficients' _t_-values or _F_-ratios to display.

  global: logical. Applied only for 'stat="F"', if 'TRUE', the model's
          _F_-ratio is traced, otherwise the coefficients'
          _F_-statistics.

     cex: numeric. Expansion factor used to label the trace
          lines.'par("cex")' bu default.

     ...: additional graphical parameters passed to 'plot' function.

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

     The response is transformed as Y=(y^lambda - 1)/lambda for each
     value of lambda ('lambda') and the model refitted. The _t_-values
     or _F_-ratios of the coefficients are saved for the display. If
     'global=TRUE', then the _F_-ratio of the whole model is plotted
     instead.

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

     The function returns an invisible list with components: 

  lambda: numeric. Vector of length 'm' with the different values of
          lambda.

t.lambda : matrix ('k x m'), where 'm' is the number of coefficients in
          model 'mod' without the intercept, with the coefficient's
          _t_-values.

f.lambda : matrix ('k x m') with the coefficient's _F_-values. if
          'global = FALSE', otherwise the matrix is ('1 x m'), with the
          corresponding model _F_-ratio.

_N_o_t_e:

     For each value of lambda the model is refitted. Computations can
     be done more efficiently and will be incorporated in future
     versions.

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

     Ernesto Barrios

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

     Box, G. E. P. and C. Fung (1995) "The Importance of Data
     Transformation in Designed Experiments for Life Testing". _Quality
     Engineering_, Vol. 7, No. 3, pp. 625-68.

     Box G. E. P, Hunter, J. S. and Hunter, W. C. (2005).  _Statistics
     for Experimenters II_. New York: Wiley.

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

     library(BHH2)
     # Lambda Plot tracing t values.
     data(woolen.data)
     woolen.lm <- lm(y~x1+x2+x3+I(x1^2)+I(x2^2)+I(x3^2)+
                         I(x1*x2)+I(x1*x3)+I(x2*x3)+I(x1*x2*x3),data=woolen.data)
     lambdaPlot(woolen.lm,cex=.8,stat="t")

     # Lambda Plot tracing F values.
     woolen2.lm <- lm(y~x1+x2+x3,data=woolen.data)
     lambdaPlot(woolen2.lm,lambda=seq(-1,1,length=41),stat="F",global=TRUE)

     # Lambda Plot tracing F values.
     data(poison.data)
     poison.lm <- lm(y~treat*poison,data=poison.data)
     lambdaPlot(poison.lm,lambda=seq(-3,1,by=.1),stat="F",global=FALSE)

