perturbate: Perturbate grid ratings

Description Usage Arguments Examples

View source: R/perturbate.R

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

1
2
3
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 repgrid object.

prop

The proportion of ratings to be perturbated.

amount

The amount set of possible perturbations. Will depend on scale range. Usually -1, 1 are reasonable settings

prob

Pobability for each amount to occur.

n

Number of perturbated grid to generate.

Examples

1
2
3
4
5
6
7
## 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)

markheckmann/OpenRepGrid documentation built on April 30, 2021, 2:33 a.m.