R/tam_mml_3pl_mstep_item_slopes_gammaslope_center.R

Defines functions tam_mml_3pl_mstep_item_slopes_gammaslope_center

## File Name: tam_mml_3pl_mstep_item_slopes_gammaslope_center.R
## File Version: 0.07


#*** centering gammaslope vector
tam_mml_3pl_mstep_item_slopes_gammaslope_center <- function( gammaslope,
        gammaslope.center.index, gammaslope.center.value  )
{
    if ( ! is.null( gammaslope.center.index ) ){
        M <- max( gammaslope.center.index )
        for (mm in 1:M){
            ind.mm <- which( gammaslope.center.index==mm )
            IM <- length(ind.mm)
            rmm <- gammaslope[ ind.mm ] - mean( gammaslope[ind.mm] )
            gammaslope[ ind.mm ] <- gammaslope.center.value[mm] / IM + rmm
        }
    }
    return(gammaslope)
}

.mml.3pl.gammaslope.center <- tam_mml_3pl_mstep_item_slopes_gammaslope_center
alexanderrobitzsch/TAM documentation built on Feb. 21, 2024, 5:59 p.m.