Skip to content
Graphviz (DOT) templates

Mixed-Effects Model Structure

Random intercepts and slopes for subjects nested in clinics.

Template previewGraphviz (DOT)
mlm Y y_ijt — outcome at time t, patient j, clinic i Fix Fixed effects: β0 + β1·time + β2·treatment + β3·time×treat Fix->Y Pat Random intercept (patient) u_j ~ N(0, σ_p²) Pat->Y Cli Random intercept (clinic) v_i ~ N(0, σ_c²) Cli->Y Slope Random slope (time | patient) u'_j ~ N(0, σ_s²) Slope->Y Err Residual ε_ijt ~ N(0, σ²) Err->Y

What this template contains

Graph
Directed
Edges
5
Source
12 lines

Make it your own.

digraph mlm {
  rankdir=TB;
  graph [bgcolor=transparent];
  node [shape=box, style="rounded,filled", fontname=Inter, fontsize=10];

  Y [label="y_ijt — outcome\nat time t, patient j, clinic i", fillcolor="#fce7f3"];
  Fix [label="Fixed effects:\nβ0 + β1·time + β2·treatment + β3·time×treat", fillcolor="#dbeafe"];
  Pat [label="Random intercept (patient)\nu_j ~ N(0, σ_p²)", fillcolor="#fef3c7"];
  Cli [label="Random intercept (clinic)\nv_i ~ N(0, σ_c²)", fillcolor="#fef3c7"];
  Slope [label="Random slope (time | patient)\nu'_j ~ N(0, σ_s²)", fillcolor="#fef3c7"];
  Err [label="Residual ε_ijt ~ N(0, σ²)", fillcolor="#dcfce7"];

  Fix -> Y; Pat -> Y; Cli -> Y; Slope -> Y; Err -> Y;
}