Last chance! 50% off unlimited learning
Sale ends in
Computes observed rating frequencies per level of a factor, in various formats.
rating.prob(x, g, type = c("prob", "cumprob", "class"))
ordered factor (ratings).
factor giving groups to be compared.
type of output to be returned: "prob"
(default) gives frequency of each rating, "cumprob"
gives cumulative frequencies (Fi is frequence of ratings <= i) and "class"
gives the most frequent rating.
Maxime HERVE <maxime.herve@univ-rennes1.fr>
require(ordinal)
data(wine)
# Frequencies
rating.prob(wine$rating,wine$contact:wine$temp)
# Cumulative frequencies
rating.prob(wine$rating,wine$contact:wine$temp,type="cumprob")
# Most frequent rating
rating.prob(wine$rating,wine$contact:wine$temp,type="class")
Run the code above in your browser using DataLab