# Data
tulip <- c(red = 81, yellow = 50, white = 27)
# Question 1: are the color equally common ?
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# this is a test of homogeneity
res <- multinom_test(tulip)
res
attr(res, "descriptives")
# Pairwise comparisons between groups
pairwise_binom_test(tulip, p.adjust.method = "bonferroni")
# Question 2: comparing observed to expected proportions
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# this is a goodness-of-fit test
expected.p <- c(red = 0.5, yellow = 0.33, white = 0.17)
res <- multinom_test(tulip, expected.p)
res
attr(res, "descriptives")
# Pairwise comparisons against a given probabilities
pairwise_binom_test_against_p(tulip, expected.p)
Run the code above in your browser using DataLab