perturbate {OpenRepGrid} | R Documentation |
Perturbate grid ratings
Description
Randomly subtract or add an amount to a proportion of the grid ratings. This emulates randomness during the rating process, producing a grid which might also have resulted.
Usage
perturbate(x, prop = 0.1, amount = c(-1, 1), prob = c(0.5, 0.5))
grids_perturbate(x, n = 10, prop = 0.1, amount = c(-1, 1), prob = c(0.5, 0.5))
Arguments
x |
A |
prop |
The proportion of ratings to be perturbated. |
amount |
The amount set of possible perturbations. Will depend on scale
range. Usually |
prob |
Probability for each amount to occur. |
n |
Number of perturbated grid to generate. |
Examples
## All results for PVAFF index when ratings are slightly perturbated
p <- indexPvaff(boeker)
l <- grids_perturbate(boeker, n = 100, prop = .1)
pp <- sapply(l, indexPvaff) # apply indexPvaff function to all perturbated grids
range(pp) # min and max PVAFF
hist(pp, xlab = "PVAFF values") # visualize
abline(v = p, col = "blue", lty = 2)
[Package OpenRepGrid version 0.1.15 Index]