View source: R/model-evaluation.R
logLik.lcModel | R Documentation |
Extract the log-likelihood of a lcModel
## S3 method for class 'lcModel'
logLik(object, ...)
object |
The |
... |
Additional arguments. |
The default implementation checks for the existence of the logLik()
function for the internal model, and returns the output, if available.
A numeric
with the computed log-likelihood. If unavailable, NA
is returned.
stats::logLik metric
data(latrendData)
if (rlang::is_installed("lcmm")) {
method <- lcMethodLcmmGBTM(
fixed = Y ~ Time,
mixture = ~ 1,
id = "Id",
time = "Time",
nClusters = 3
)
gbtm <- latrend(method, data = latrendData)
logLik(gbtm)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.