| binaryLink | R Documentation |
supcluster when the outcome data object is binary
Calculates the log-likelihood for a logistic model with log-odds μ+x where x is a frailty
binaryLink(x)
x |
A vector of binary data with values of 0 and 1 or |
A function that given a vector of frialties followed by a value of μ calculates the log-likelihood
David Alan Schoenfeld
#Note the number of iterations is small to control run time
generatedData=generate.cluster.data(.25,npats=25,clusts=c(12,8),beta=c(-5,5),
outcomeModel=binaryOutcome(0))
usBinary=supcluster(generatedData[[1]],outcome="outcome",
maxclusters=5,nstart=100,n=200,fbeta=FALSE,
linkLikelihood=binaryLink(generatedData[[2]]))
## The function is currently defined as
function (x)
{
m = length(x)
outfcn = function(parm2) {
bx = parm2[m + 1] + parm2[1:m]
loglik = sum(x * bx) - sum(log(1 + exp(bx)))
return(loglik)
}
return(outfcn)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.