p_thirt: Calculate probability

View source: R/probability.R

p_thirtR Documentation

Calculate probability

Description

Calculate the probability of all potential response patterns for each respondent

Usage

p_thirt(gamma, items, persons, picked_order = NULL)

Arguments

gamma

a data.frame of length ⁠[total binary outcomes]⁠ with two variables: variable pair of the format i-j for item pair ij, variable gamma for threshold parameters.

items

a data.frame of length ⁠[total items]⁠ with five variables: variable item of the format i for item number i, variable block of the format b for block number b, variable dim of the format d for dimension number d, variable lambda for loadings, variable psisq for uniqueness, variable dim for dimensions.

persons

a data.frame of length ⁠[number of people]⁠ with variables: variable person of the format p for person number p, variables named theta_d for dimension number d.

picked_order

a data.frame of length ⁠[person x block]⁠ with four variables: variable person of the format p for person number p, variable block of the format b for block number b, variable resp of the format r for response order number r which follows mupp::find_all_permutation orders, variable seq which includes the items in ranked order by each person. data.frame similar to output in simulate_thirt_resp()$resp

Value

a list of length ⁠[block]⁠ of matrices with dimension ⁠[person X permutation]⁠ of probabilities for each response pattern per block.

Examples

## Not run: 
set.seed(202106)

params <- simulate_thirt_params(n_person = 200,
                                n_item   = 3,
                                n_block  = 2,
                                n_dim    = 3)

prob   <- do.call(p_thirt, params)

for(block in seq_along(prob)){
  print(summary(prob[[block]]))
}

## End(Not run)


nguyenllpsych/thirt documentation built on Feb. 14, 2024, 10:53 p.m.