plotMultinom {EMT} | R Documentation |
This function takes the results of multinomial.test
as input and plots the calculated probability
distribution.
plotMultinom(listMultinom, showmax = 50)
listMultinom |
a list created by running the function |
showmax |
maximum number of bars to show in the plot (to avoid long tails). |
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.
The first argument (listMultinom) is returned without modification.
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.
Uwe Menzel <uwemenzel@gmail.com>
The Multinomial Distribution: multinomial.test
## 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