R/CentMnrm.R

Defines functions CentMnrm

CentMnrm <-
function(reshOBJ)
{
  
  
  catanz <- rep(rep(sapply(reshOBJ$aDD,function(x)x$anz_cat),each=2),each=nlevels(reshOBJ$gr))
  
  matList <- lapply(catanz,function(scr)
  {
    toD <- matrix( - 1/scr,ncol=scr,nrow=scr)
    diag(toD) <- diag(toD) + 1
    toD
  })  
  
  
  to2 <- cumsum(catanz)
  from1   <- c(1,to2[-length(to2)]+1)
  
  cem1 <- matrix(0,ncol=sum(catanz),nrow=sum(catanz))
  
  
  for(i in 1:length(from1))
  {
    fr <- from1[i]
    tt <- to2[i]
    
    cem1[fr:tt,fr:tt] <- matList[[i]]
  }
  
  cem1  
}

Try the mcIRT package in your browser

Any scripts or data that you put into this service are public.

mcIRT documentation built on May 29, 2017, 9:33 p.m.