R/covLCA.updatePrior.R

covLCA.updatePrior <-
function(b,xx,R) 
{
    bb <- matrix(b,ncol=(R-1)) #A: rows=covariates, col=LC : beta_pj
    exb <- exp(xx %*% bb) #A: rows=indiv, col=LC
    p <- cbind(exb,1)/(rowSums(exb)+1) #A: LC probabilities, rows=indiv, cols=LC (where last column corresponds to last LC, the reference) 
	
	return(p)
}

Try the covLCA package in your browser

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

covLCA documentation built on May 2, 2019, 9:35 a.m.