sim.attitude: RaRandom responses for attitude tests

Description Usage Arguments Details Value Examples

View source: R/sim.attitude.R

Description

Generate a random patttern of dichotomous responses for an attitude test.

Usage

1
2
3
sim.attitude(hits, x.min = min(hits), x.max = max(hits), p = NULL,
    incr.diff = TRUE, time.limit = FALSE, floor = FALSE,
    ceiling = FALSE, seed = NULL)

Arguments

hits

Numerical vector of correct responses.

x.min

Minimum observable value.

x.max

Maximum observable value.

p

Probability of correct responses representing the ability of the subject.

incr.diff

Logical value. When TRUE, the items are assumed with increasing difficulty.

time.limit

Logical value indicating if the responses are done under time pressure.

floor

Logical value. If TRUE, the function will generate a response pattern with floor effect.

ceiling

Logical value. If TRUE, the function will generate a response pattern with ceiling effect.

seed

Numerical value to use as seed to generate pseurorandom values.

Details

The function simulates a response pattern of a subject to an attitude test. This hypothetical test consist on a set of alternatives in which, for each trial, one alternative is right and the others are wrong.

Value

A list object in which the first element (pattern) contains the simulated responses and the second element (score) indicates if each response is correct (1) or uncorrect (0).

Examples

1
2
3
4
5
6
7
8
9
# Simulation of responses for a test with fifteen items
# and four response alternatives (coded from 1 to 4).
# -> vector of correct responses:
correct <- c(1, 2, 1, 3, 3, 4, 3, 2, 1, 2, 2, 2, 4, 1, 4)
# -> simulation:
sim.attitude(correct, seed=16)
# -> simulation with time pressure:
sim.attitude(correct, p=0.7, time.limit=TRUE, seed=46)
# (NAs represent missed responses, which are considered wrong)

DavideMassidda/raschTools documentation built on April 27, 2021, 4:24 a.m.