replacement.matrix: Replacement matrix.

View source: R/replacement.matrix.R

replacement.matrixR Documentation

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, …, 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 γ_{+}, gam[,2] indicates the faking bad parameter γ_{-}.

del

Delta parameter: del[,1] indicates the faking good parameter δ_{+}, del[,2] indicates the faking bad parameter δ_{-}.

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 ≤q r ≤q Q) in the matrix indicates the conditional probability distribution

p(k=r|h=c,π), \qquad h=1,…,Q

π (p) denotes the overall replacement probability.

Author(s)

Massimiliano Pastore

See Also

dgBetaD, pfake, pfakegood, pfakebad

Examples

## 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")

sgr documentation built on April 14, 2022, 5:08 p.m.

Related to replacement.matrix in sgr...