replacement.matrix {sgr} | R 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: |
p |
Overall probability of replacement: |
gam |
Gamma parameter: |
del |
Delta parameter: |
fake.model |
A character string
indicating the model for the conditional replacement distribution. The options are: |
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.
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")