Ord_plot                 package:vcd                 R Documentation

_O_r_d _P_l_o_t_s

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

     Ord plots for diagnosing discrete distributions.

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

     Ord_plot(obj, legend = TRUE, estimate = TRUE, tol = 0.1, type = NULL,
       xlim = NULL, ylim = NULL, xlab = "Number of occurrences",
       ylab = "Frequency ratio", main = "Ord plot", gp = gpar(cex = 0.5),
       name = "Ord_plot", newpage = TRUE, pop = TRUE, ...)
     Ord_estimate(x, type = NULL, tol = 0.1)

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

     obj: either a vector of counts, a 1-way table of frequencies of
          counts or a data frame or matrix with frequencies in the
          first column and the corresponding counts in the second
          column.

  legend: logical. Should a legend be plotted?.

estimate: logical. Should the distribution and its parameters be
          estimated from the data? See details.

     tol: tolerance for estimating the distribution. See details.

    type: a character string indicating the distribution, must be one
          of '"poisson"', '"binomial"', '"nbinomial"' or '"log-series"'
          or 'NULL'. In the latter case the distribution is estimated
          from the data. See details.

    xlim: limits for the x axis.

    ylim: limits for the y axis.

    xlab: a label for the x axis.

    ylab: a label for the y axis.

    main: a title for the plot.

      gp: a '"gpar"' object controlling the grid graphical parameters
          of the points.

    name: name of the plotting viewport.

 newpage: logical. Should 'grid.newpage' be called  before plotting?

     pop: logical. Should the viewport created be popped?

     ...: further arguments passed to 'grid.points'.

       x: a vector giving intercept and slope for the (fitted) line in
          the Ord plot.

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

     The Ord plot plots the number of occurrences against a certain
     frequency ratio (see Friendly (2000) for details) and should give
     a straight line if the data comes from a poisson, binomial,
     negative binomial or log-series distribution.  The intercept and
     slope of this straight line conveys information about the
     underlying distribution.

     'Ord_plot' fits a usual OLS line (black) and a weighted OLS line
     (red).  From the coefficients of the latter the distribution is
     estimated by 'Ord_estimate' as described in Table 2.10 in Friendly
     (2000).  To judge whether a coefficient is positive or negative a
     tolerance given by 'tol' is used.  If none of the distributions
     fits well, no parameters are estimated.  Be careful with the
     conclusions from 'Ord_estimate' as it implements just some simple
     heuristics!

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

     A vector giving the intercept and slope of the weighted OLS line.

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

     Achim Zeileis Achim.Zeileis@R-project.org

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

     J. K. Ord (1967), Graphical methods for a class of discrete
     distributions, _Journal of the Royal Statistical Society_, *A
     130*, 232-238.

     Michael Friendly (2000), _Visualizing Categorical Data_. SAS
     Institute, Cary, NC.

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

     ## Simulated data examples:
     dummy <- rnbinom(1000, size = 1.5, prob = 0.8)
     Ord_plot(dummy)

     ## Real data examples:
     data(HorseKicks)
     data(Federalist)
     data(Butterfly)
     data(WomenQueue)

     grid.newpage()
     pushViewport(viewport(layout = grid.layout(2, 2)))

     pushViewport(viewport(layout.pos.col=1, layout.pos.row=1))
     Ord_plot(HorseKicks, main = "Death by horse kicks", newpage = FALSE)
     popViewport()

     pushViewport(viewport(layout.pos.col=1, layout.pos.row=2))
     Ord_plot(Federalist, main = "Instances of 'may' in Federalist papers", newpage = FALSE)
     popViewport()

     pushViewport(viewport(layout.pos.col=2, layout.pos.row=1))
     Ord_plot(Butterfly, main = "Butterfly species collected in Malaya", newpage = FALSE)
     popViewport()

     pushViewport(viewport(layout.pos.col=2, layout.pos.row=2))
     Ord_plot(WomenQueue, main = "Women in queues of length 10", newpage = FALSE)
     popViewport(2)

