## 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) # p.value = 0.0767
## Plot the probability distribution:
plotMultinom(out)
Run the code above in your browser using DataLab