plotMD {benchdamic} | R Documentation

## plotMD

### Description

A function to plot mean difference (MD) and zero probability difference (ZPD) values between estimated and observed values.

### Usage

    plotMD(data, difference = NULL, split = TRUE)

### Arguments

`data` | a list, output of the `fitModels` function or a 'data.frame' object with `Model`, `Y`, `Y0`, `MD`, and `ZPD` columns containing the model name, the observed values for the mean and the zero proportion and the differences between observed and estimated values.
`difference` | character vector, either `MD` or `ZPD` to plot the differences between estimated and observed mean counts or the differences between estimated zero probability and observed zero proportion.
`split` | Display each model mean differences in different facets (default `split = TRUE`). If `FALSE`, points are not displayed for more clear representation.

### Value

a `ggplot` object.

### See Also

`fitModels` and `RMSE` for the model estimations and the RMSE computations respectively. `plotRMSE` for the graphical evaluation of the RMSE values.

### Examples

    # Generate some random counts
    counts = matrix(rnbinom(n = 60, size = 3, prob = 0.5), nrow = 10, ncol = 6)

    # Estimate the counts assuming several distributions
    GOF <- fitModels(
        counts = counts, models = c(
            "NB", "ZINB",
            "DM", "ZIG", "HURDLE"
        ), scale_ZIG = c("median", "default"), scale_HURDLE =
            c("median", "default")
    )

    # Plot the results
    plotMD(data = GOF, difference = "MD", split = TRUE)
    plotMD(data = GOF, difference = "ZPD", split = TRUE)

[Package benchdamic version 1.0.0 Index]