rating.prob: Observed rating frequencies

View source: R/rating.prob.R

rating.probR Documentation

Observed rating frequencies

Description

Computes observed rating frequencies per level of a factor, in various formats.

Usage

rating.prob(x, g, type = c("prob", "cumprob", "class"))

Arguments

x

ordered factor (ratings).

g

factor giving groups to be compared.

type

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.

Author(s)

Maxime HERVE <maxime.herve@univ-rennes1.fr>

Examples

if (require("ordinal",quietly=TRUE)) {
  data(wine,package="ordinal")

  # 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")
}

RVAideMemoire documentation built on June 8, 2025, 12:46 p.m.