Site under development, current content may not be accurate
A
Longitudinal Data Science
Platform
A
Longitudinal Data Science
Platform
Open Source Documentation, Examples, Templates, and Tools
demo_model.r
library(tidyverse)
library(glmmTMB)
data(demo_data)
ggplot(demo_data, aes(x = predictor_variable, y = response_variable)) +
geom_point(color = "#3498db", size = 3) +
geom_smooth(method = "lm", color = "#e74c3c", se = FALSE) +
labs(
title = "Relationship between Predictor and Response",
x = "Predictor Variable",
y = "Response Variable",
caption = "Sample data for illustrative purposes"
) +
theme_minimal()
model <- glmmTMB(
response ~ 1 + predictor1 + predictor2 + factor(timepoint) + (1 + timepoint | group),
family = truncated_genpois(link = "log"),
ziformula = ~ 1 + predictor1 + predictor2 + factor(timepoint) + (1 + timepoint | group),
data = demo_data,
control = glmmTMBControl(parallel = 16)
)
summary(model)