plot.design             package:graphics             R Documentation

_P_l_o_t _U_n_i_v_a_r_i_a_t_e _E_f_f_e_c_t_s _o_f _a '_D_e_s_i_g_n' _o_r _M_o_d_e_l

_D_e_s_c_r_i_p_t_i_o_n:

     Plot univariate effects of one ore more 'factor's, typically for a
     designed experiment as analyzed by 'aov()'. Further, in S this a
     method of the 'plot' generic function for 'design' objects.

_U_s_a_g_e:

     plot.design(x, y = NULL, fun = mean, data = NULL, ...,
                 ylim = NULL, xlab = "Factors", ylab = NULL,
                 main = NULL, ask = NULL, xaxt = par("xaxt"),
                 axes = TRUE, xtick = FALSE)

_A_r_g_u_m_e_n_t_s:

       x: either a data frame containing the design factors and
          optionally the response, or a 'formula' or 'terms' object.

       y: the response, if not given in x.

     fun: a function (or name of one) to be applied to each subset.  It
          must return one number for a numeric (vector) input.

    data: data frame containing the variables referenced by 'x' when
          that is formula like.

     ...: graphical arguments such as 'col', see 'par'.

    ylim: range of y values, as in 'plot.default'.

    xlab: x axis label, see 'title'.

    ylab: y axis label with a 'smart' default.

    main: main title, see 'title'.

     ask: logical indicating if the user should be asked before a new
          page is started - in the case of multiple y's.

    xaxt: character giving the type of x axis.

    axes: logical indicating if axes should be drawn.

   xtick: logical indicating if ticks (one per factor) should be drawn
          on the x axis.

_D_e_t_a_i_l_s:

     The supplied function will be called once for each level of each
     factor in the design and the plot will show these summary values. 
     The levels of a particular factor are shown along a vertical line,
     and the overall value of 'fun()' for the response is drawn as a
     horizontal line.

     This is a new R implementation which will not be completely
     compatible to the earlier S implementations.  This is not a bug
     but might still change.

_N_o_t_e:

     A big effort was taken to make this closely compatible to the S
     version.  However, 'col' (and 'fg') specification has different
     effects.

_A_u_t_h_o_r(_s):

     Roberto Frisullo and Martin Maechler

_R_e_f_e_r_e_n_c_e_s:

     Chambers, J. M. and Hastie, T. J. eds (1992) _Statistical Models
     in S_. Chapman & Hall, London, *the* _white book_, pp. 546-7 (and
     163-4).

     Freeny, A. E. and Landwehr, J. M. (1990) Displays for data from
     large designed experiments; Computer Science and Statistics: Proc.
     22nd Symp\. Interface, 117-126, Springer Verlag.

_S_e_e _A_l_s_o:

     'interaction.plot' for a 'standard graphic' of designed
     experiments.

_E_x_a_m_p_l_e_s:

     require(stats)
     plot.design(warpbreaks)# automatic for data frame with one numeric var.

     Form <- breaks ~ wool + tension
     summary(fm1 <- aov(Form, data = warpbreaks))
     plot.design(       Form, data = warpbreaks, col = 2)# same as above

     ## More than one y :
     utils::str(esoph)
     plot.design(esoph) ## two plots; if interactive you are "ask"ed

     ## or rather, compare mean and median:
     op <- par(mfcol = 1:2)
     plot.design(ncases/ncontrols ~ ., data = esoph, ylim = c(0, 0.8))
     plot.design(ncases/ncontrols ~ ., data = esoph, ylim = c(0, 0.8),
                 fun = median)
     par(op)

