#' PIMap
#'
#' Plot a person-item / Wright map
#'
#'
#' @param obj An BPCM model or BRSM model
#' @param g If BPCM / BRSM has DIF, specify group of interest
#' @export PIMap
PIMap = function(obj, g = 1){
if(obj$DIF == TRUE) {
show("This is not available for DIF object")
}else{
codaSamples = obj$mcmc
data = obj$data
item = obj$item
theta.v = theta(obj, g)[,3]
data = data[, item]
if(min(apply(data, 2, min,na.rm = TRUE)) == 0){data = data + 1}
K = apply(data, 2, max,na.rm = TRUE)
beta.v = beta(obj, g)[,3]
WrightMap::wrightMap(theta.v, sort(beta.v))
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.