TABLE OF CONTENTS


makeLikelihood/mklik.frail [ Functions ]

NAME

    mklik.frail --- likelihood of frailty for cluster i

FUNCTION

Compute the loglikeilhood of the frailty of cluster i

SYNOPSIS

2256 mklik.frail <- function(i, hazard, frailty, regression)

INPUTS

    i          index of the frailty. The frailty value is stored in frailty$x[i]
    hazard     RCurve for hazard
    frailty    RCurve for frailty
    regression RRegression structure

OUTPUTS

    lik    loglikelihood of frailty$x[i]

SOURCE

2259 {
2260     ind <- which(regression$cluster == i)
2261     Ui <- frailty$x[i]
2262     status <- regression$status[ind]
2263     lp <- regression$lp[ind]
2264     cumhaz <- hazard$ycum[ind]
2265     lik <- log(frailty$y[i])
2266     lik <- lik + sum(status * log(Ui))
2267     lik <- lik - sum(Ui * cumhaz * exp(lp))
2268     return(lik)   
2269 }