rrating: Simulate Likert-like Item Responses

Description Usage Arguments Details Value Examples

Description

Generates random distributions of answers to Likert-type items answered on a numeric (integer) scale.

Usage

1
2
rrating(n, mean = 3, scale.from = 1, scale.to = 5, sd.norm = 1,
  shift.to.mean = "none")

Arguments

n

number of observations.

mean

mean of the normal distribution to be approximated.

scale.from

bottom-end of the possible values in scale.

scale.to

top-end of the possible values in scale.

sd.norm

standard deviation of the normal distribution to be approximated.

shift.to.mean

if set to "none", the mean of observations will generally not match the mean of the normal to be approximated; to shift the observations to match it, set to either "quick", "iterative", or "round-robin" (algorithms discussed in the details)

Details

TODO

Value

A vector of n length.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Simulate 1000 responses for question "From 1 to 5, how much do you like pizza?"
responses = rrating(1000, mean = 4, scale.from = 1, scale.to = 5)
plot(table(responses))
mean(responses)
#
# mean is not 4, because tails of the normal distribution being approximated
# were binned with the boundaries. To keep mean at four, set the shift option:
responses.shifted = rrating(1000, mean = 4, scale.from = 1, scale.to = 5,
shift.to.mean = "quick")
plot(table(responses.shifted))
mean(responses.shifted)

diogomarques/rrating documentation built on May 15, 2019, 8:46 a.m.