Learn R Programming

sgr (version 1.3.1)

replacement.matrix: Replacement matrix.

Description

Builds the replacement matrix.

Usage

replacement.matrix(Q = 5, p = c(0,0), gam = c(1,1), del = c(1,1),
    fake.model = c("uninformative", "average", "slight", "extreme"))

Arguments

Q

Max value in the discrete r.v. range: \(1, \ldots, Q\).

p

Overall probability of replacement: p[1] indicates the faking good probability, p[2] indicates the faking bad probability.

gam

Gamma parameter: gam[,1] indicates the faking good parameter \(\gamma_{+}\), gam[,2] indicates the faking bad parameter \(\gamma_{-}\).

del

Delta parameter: del[,1] indicates the faking good parameter \(\delta_{+}\), del[,2] indicates the faking bad parameter \(\delta_{-}\).

fake.model

A character string indicating the model for the conditional replacement distribution. The options are: uninformative (default option) [gam = c(1,1) and del = c(1,1)]; average [gam = c(3,3) and del = c(3,3)]; slight [gam = c(1.5,4) and del = c(4,1.5)]; extreme [gam = c(4,1.5) and del = c(1.5,4)].

Value

Gives a \(Q \times Q\) matrix with replacement probabilities. Each row \(r\) (\(1 \leq r \leq Q\)) in the matrix indicates the conditional probability distribution $$p(k=r|h=c,\pi), \qquad h=1,\ldots,Q$$ \(\pi\) (p) denotes the overall replacement probability.

See Also

dgBetaD, pfake, pfakegood, pfakebad

Examples

Run this code
# NOT RUN {
## no replacements
replacement.matrix(Q=7) 

## faking good
replacement.matrix(Q=7,p=c(.5,0))
replacement.matrix(Q=7,p=c(.5,0),gam=8,del=2.5)

## faking bad
replacement.matrix(Q=7,p=c(0,.5))
replacement.matrix(Q=7,p=c(0,.5),gam=8,del=2.5)

## faking good and faking bad
replacement.matrix(Q=7,p=c(.3,.5),gam=c(8,8),del=c(2.5,2.5))

## using the fake.model argument
replacement.matrix(Q=7,p=c(0,.4),fake.model="extreme")
replacement.matrix(Q=7,p=c(.4,0),fake.model="extreme")
replacement.matrix(Q=7,p=c(.4,.4),fake.model="slight")
# }

Run the code above in your browser using DataLab