R/categoryCount.R

Defines functions categoryCount

Documented in categoryCount

#' categoryCount
#'
#' For response category analysis, count the observation for each category
#'
#' Reference
#' Linacre, J. M. (2002). Optimizing rating scale category effectiveness. Journal of applied measurement, 3(1), 85-106.
#'
#' @param obj Any model in the package
#' @export categoryCount

categoryCount = function(obj){
  if(obj$DIF == TRUE){
    show("This is not available for DIF object")
  }else{
    item = obj$item
    data = obj$data
    m = NULL
    for(i in item){
      m = rbind(m, table(data[,i]))
    }
    rownames(m) = item
    m
  }
}
changxiulee/BayesianRasch documentation built on Nov. 18, 2019, 6:54 a.m.