This function is generic; method functions can be written to handle specific classes of objects.

logLik1(modfit, dt1, dtInit)

Arguments

modfit

an object representing a model fitted to data using maximum likelihood estimation.

dt1

a data frame with data for one subject, for whom the log-likelihood function is to be evaluated.

dtInit

an optional auxiliary data frame.

Value

Numeric scalar value representing the contribution of a given subject to the overall log-likelihood returned by logLik.

Details

Calculates contribution of one subject to the log-likelihood

This function is generic; method functions can be written to handle specific classes of objects.

References

Galecki, A., & Burzykowski, T. (2013). *Linear Mixed-Effects Models: A Step-by-Step Approach*. Springer.

Author

Andrzej Galecki and Tomasz Burzykowski

Examples

  library(nlme)
  logLik(fm1 <- lme(distance ~ age, data = Orthodont)) # random is ~ age
#> 'log Lik.' -221.3183 (df=6)
  dt1 <- subset(Orthodont, Subject == "M01")
  logLik1(fm1, dt1)
#> [1] -8.980609