logLik1.lme: Calculates contribution of one subject to the log-likelihood...

View source: R/logLik1.R

logLik1.lmeR Documentation

Calculates contribution of one subject to the log-likelihood for an lme object

Description

This is a method for the logLik1 generic function.

Usage

## S3 method for class 'lme'
logLik1(modfit, dt1, dtInit)

Arguments

modfit

an lme object representing a model fitted using maximum likelihood.

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.

Details

Calculates the profile likelihood (with beta profiled out) for one subject. Data with one level of grouping only. The correlation component in modelStruct is not implemented.

Value

Numeric scalar value representing the contribution of a given subject to the overall log-likelihood returned by logLik applied to an lme object defined by the modfit argument.

Author(s)

Andrzej Galecki and Tomasz Burzykowski

Examples


library(nlme)
data(armd, package = "nlmeU")
lm3.form <- visual ~ visual0 + time + treat.f 
fm16.5ml <- lme(lm3.form,                         
                random = list(subject = pdDiag(~time)), 
                weights = varPower(form = ~time),
                data = armd, method = "ML") # M16.5
df1 <- subset(armd, subject = "1")          # Panel R20.7
logLik1(fm16.5ml, df1)


nlmeU documentation built on Aug. 25, 2025, 5:12 p.m.