View source: R/replacement.matrix.R
replacement.matrix | R Documentation |
Builds the replacement matrix.
replacement.matrix(Q = 5, p = c(0,0), gam = c(1,1), del = c(1,1), fake.model = c("uninformative", "average", "slight", "extreme"))
Q |
Max value in the discrete r.v. range: 1, …, Q. |
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: |
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.
Massimiliano Pastore
dgBetaD
, pfake
, pfakegood
, pfakebad
## 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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.