R/cprob.r

Defines functions cprob

# joint probability of genotype and phenotype
cprob <- function(theta, X, y, delta, p, base.dist, cuts, nbase)
{

vbeta <- theta[-c(1:nbase)]  
if(base.dist=="lognormal") etheta <-  c(theta[1], exp(theta[2]))
else etheta <- exp(theta[1:nbase])

xbeta <- c(X%*%vbeta)

haz <- hazards(base.dist, y, etheta, cuts)*exp(xbeta)
Haz <- cumhaz(base.dist, y, etheta, cuts)*exp(xbeta)
return((haz^delta)*exp(-Haz)*p)

}

Try the FamEvent package in your browser

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

FamEvent documentation built on Nov. 17, 2022, 5:06 p.m.