R/gdm_est_a_centerslopes.R

Defines functions gdm_est_a_centerslopes

## File Name: gdm_est_a_centerslopes.R
## File Version: 0.03

gdm_est_a_centerslopes <- function(a, centerslopes, Qmatrix, TD )
{
    if (centerslopes){
        if (TD>1){
            m11 <- t( colSums( a[,,1] ) / colSums( Qmatrix ) )
            a[,,1] <- a[,,1] / m11[ rep(1,I), ]
        }
        if (TD==1){
            m11 <- t( colSums( a ) / colSums( Qmatrix ) )
            a <- a / m11[ rep(1,I), ]
        }
    }
    return(a)
}
alexanderrobitzsch/CDM documentation built on Aug. 30, 2022, 12:31 a.m.