boeck_predict: Model-predicted response distribution.

Description Usage Arguments Value Examples

Description

Calculate the predicted response distribution given the posterior median/mean of the item parameters and a matrix theta of person parameters.

Usage

1
2
3
4
boeck_predict(fit_sum = NULL, theta = matrix(0, N, S2), betas = NULL,
  beta_ARS_extreme = NULL, measure = c("Median", "Mean"), S = NULL,
  N = 1, J = NULL, revItem = NULL, traitItem = NULL,
  fitModel = NULL)

Arguments

fit_sum

List. A summary of theta and beta parameters as returned from tidyup_irtree_fit.

theta

Matrix. A matrix of person parameters for which the predictions should be made.

betas

Jx4 matrix with item parameters on four response dimensions (middle, extreme, acquiescence, relevant trait defined by traitItem).

beta_ARS_extreme

only for genModel="ext": probability (on probit scale) of choosing category 5 (vs.4) in case of ARS

measure

Character vector that indicates whether the mean (default) or the median of the posterior distribution should be plotted.

S

number of latent processes to be measured

N

number of persons

J

number of items

revItem

vector of length J specifying reversed items (1=reversed, 0=regular)

traitItem

vector of length J specifying the underlying traits (e.g., indexed from 1...5). Standard: only a single trait is measured by all items. If the Big5 are measured, might be something like c(1,1,1,2,2,2,...,5,5,5,5)

fitModel

Character. Either "2012" (Boeckenholt Model without acquiescence) or "ext" (Acquiescence Model). Details about all implemented models are described in the section Models below.

Value

Function returns a data frame in long format with predicted response probability for each person-item combination.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Not run: 
# generate data
N <- 20
J <- 10
betas <- cbind(rnorm(J, .5), rnorm(J, .5), rnorm(J, 1.5), rnorm(J, 0))
dat <- generate_irtree_ext(N = N, J = J, betas = betas, beta_ARS_extreme = .5)

# fit model
res1 <- fit_irtree(dat$X, revItem = dat$revItem, M = 200, warmup = 200)
res2 <- summarize_irtree_fit(res1)
res3 <- tidyup_irtree_fit(res2)

# expected frequencies
boeck_predict(res3)

## End(Not run)

hplieninger/mpt2irt documentation built on May 17, 2019, 4:54 p.m.