R: Plot the Probability distribution fot the Exact Multinomial...

plotMultinom {EMT} | R Documentation

## Plot the Probability distribution fot the Exact Multinomial Test

### Description

This function takes the results of `multinomial.test` as input and plots the calculated probability distribution.

### Usage

    plotMultinom(listMultinom, showmax = 50)

### Arguments

`listMultinom` | a list created by running the function `multinomial.test`.
`showmax` | maximum number of bars to show in the plot (to avoid long tails).

### Details

The function `multinomial.test` creates an output list that is used as input in `plotMultinom` to depict some results. If the default approach was used, the figure shows the exact probabilities of all possible outcomes of the experiment. If the Monte Carlo approach was used, the relative frequencies of the outcomes are shown as occurred during the simulated withdrawals. The probabilities/relative frequencies are shown in descending order from the left to the right.

### Value

The first argument (listMultinom) is returned without modification.

### Note

For better visibility, the parameter `showmax` excludes very long right tails from the plot. However, the default value of `showmax` should be incremented to get a significant plot if the number of possible outcomes is big.

### Author(s)

Uwe Menzel <uwemenzel@gmail.com>

### See Also

The Multinomial Distribution: `multinomial.test`

### Examples

    ## Load the EMT package:
    library(EMT)

    ## input and calculation of p-values:
    observed <- c(5,2,1)
    prob <- c(0.25, 0.5, 0.25)
    out <- multinomial.test(observed, prob)

    ## Plot the probability distribution:
    plotMultinom(out)
    plotMultinom(out, showmax = 30)  # suppress part of the tail in the plot

[Package EMT version 1.1 Index]