distplot                 package:vcd                 R Documentation

_D_i_a_g_n_o_s_t_i_c _d_i_s_t_r_i_b_u_t_i_o_n _p_l_o_t_s

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

     Diagnostic distribution plots: poissonness, binomialness and
     negative bionomialness plots.

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

     distplot(obj, type = c("poisson", "binomial", "nbinomial"),
              size = NULL, lambda = NULL, legend = TRUE, ylim = NULL,
              line.col = 2, conf.int = TRUE, conf.level = 0.95, main = NULL,
              xlab = "Number of occurrences", ylab = "Distribution metameter", ...)

_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.

    type: a character string indicating the distribution.

    size: the size argument for the binomial distribution, only
          required if 'type' is '"binomial"'. If set to 'NULL', 'size'
          is taken to be the maximum count.

  lambda: parameter of the poisson distribution. If type is '"poisson"'
          and 'lambda' is specified a leveled poissonness plot is
          produced.

  legend: logical. Should a legend be plotted?.

    ylim: limits for the y axis.

line.col: color for fitted line.

conf.int: logical. Should confidence intervals be plotted?.

conf.level: confidence level for confidence intervals.

    main: a title for the plot.

    xlab: a label for the x axis.

    ylab: a label for the y axis.

     ...: further arguments passed to 'plot'.

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

     'distplot' plots the number of occurrences (counts) against the
     distribution metameter of the specified distribution. If the
     distribution fits the data, the plot should show a straight line.
     See Friendly (2000) for details.

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

     Achim Zeileis

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

     D. C. Hoaglin (1980), A poissonness plot, _The American
     Statistican_, *34*, 146-149.

     D. C. Hoaglin & J. W. Tukey (1985), Checking the shape of discrete
     distributions. In D. C. Hoaglin, F. Mosteller, J. W. Tukey (eds.),
     _Exploring Data Tables, Trends and Shapes_, chapter 9. John Wiley
     & Sons, New York.

     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)
     distplot(dummy, type = "nbinomial")

     ## Real data examples:
     data(HorseKicks)
     data(Federalist)
     data(Saxony)
     distplot(HorseKicks, type = "poisson")
     distplot(HorseKicks, type = "poisson", lambda = 0.61)
     distplot(Federalist, type = "poisson")
     distplot(Federalist, type = "nbinomial")
     distplot(Saxony, type = "binomial", size = 12)

