# Load the example data
data(grwth_data)
# Fit the model
lmm <- lmmModel(
data = grwth_data,
sample_id = "subject",
time = "Time",
treatment = "Treatment",
tumor_vol = "TumorVolume",
trt_control = "Control",
drug_a = "DrugA",
drug_b = "DrugB",
combination = "Combination"
)
# Obtain log-likelihood displacement for each subject
logLikSubjectDisplacements(model = lmm)
# Modifying the threshold for log-likelihood displacement
logLikSubjectDisplacements(model = lmm, disp_thrh = 1)
# Calculating the log-likelihood contribution in a model with a variance structure specified
lmm_var <- lmmModel(
data = grwth_data,
sample_id = "subject",
time = "Time",
treatment = "Treatment",
tumor_vol = "TumorVolume",
trt_control = "Control",
drug_a = "DrugA",
drug_b = "DrugB",
combination = "Combination",
weights = nlme::varIdent(form = ~ 1|SampleID)
)
# Calculate the log-likelihood contribution
logLikSubjectDisplacements(model = lmm, var_name = "SampleID")
Run the code above in your browser using DataLab