Repeated Measures Outcome — Trajectory Diagnostics & Hypothesis Testing
Open-source skill.
Workflow
Read each step file in workflow/ before executing that step.
| Step |
File |
Executor |
Output |
| Collect |
workflow/01-collect-inputs.md |
Main Agent |
Structured input summary |
| Diagnose |
workflow/02-check-distribution.md |
Main Agent |
PART 1 code block |
| Test |
workflow/03-run-primary-test.md |
Main Agent |
PART 2-3 code blocks |
Decision Tree
1. DATA FORMAT CHECK
├── Wide → reshape to long before proceeding
└── Long → continue
2. TIME POINTS
├── Exactly 2 → paired comparisons path
└── 3+ → repeated measures ANOVA / mixed ANOVA path
3. GROUP STRUCTURE
├── No between-subjects factor → one-way RM-ANOVA (within-subjects only)
└── Between-subjects factor → mixed ANOVA (time × group)
4. SPHERICITY (if 3+ time points)
├── Mauchly p ≥ .05 → uncorrected F
└── Mauchly p < .05 → Greenhouse-Geisser / Huynh-Feldt correction
Required Inputs
| Role |
What to collect |
| Outcome (Y) |
Variable name, units, what it measures (continuous) |
| Time variable |
Measurement occasions, how many, equally spaced? |
| Subject/ID variable |
What identifies the same individual across time |
| Group variable |
Between-subjects factor (treatment, condition, etc.) |
| Covariates |
Time-varying? Time-invariant? |
| Data format |
Long (one row per obs) or wide (one row per subject) |
Code Structure
PART 0: Setup & Data Loading (+ reshape if wide)
PART 1: Trajectory Diagnostics → plot_01_trajectories.png
PART 2: Primary Hypothesis Test → plot_02_interaction.png
PART 3: Recommendation Block → text listing additional analyses available
Reporting Standards
- p-values: "< .001" not "0.000"; exact to 3 decimals otherwise
- Effect sizes: Cohen's d (paired t-test), partial eta-squared (RM-ANOVA/mixed ANOVA)
- 95% CIs: always for mean differences
- Degrees of freedom: always with t and F statistics
- Sphericity: Mauchly's W, p; if violated, GG epsilon and corrected p
- ICC: report value with interpretation
- Sample size: final analytic N (subjects) and total observations
- Decimal places: 2 for M/SD, 3 for p and effect sizes
- Non-significance: "not statistically significant at alpha = .05" — never "no effect"
Hypothesis Tests
| Scenario |
Normal |
Non-Normal |
| 2 time points (paired) |
Paired t-test |
Wilcoxon signed-rank |
| 3+ time points, 1 group |
One-way RM-ANOVA + sphericity |
Friedman test |
| 3+ time points, 2+ groups |
Mixed ANOVA (time x group) |
— |
Cross-sectional group comparisons → vera-stat-continuous-testing.
Example Dataset
R built-in ChickWeight: outcome = weight, time = Time (0, 2, 4, ..., 21 days),
subject = Chick, group = Diet (1, 2, 3, 4).
Python: sm.datasets.get_rdataset("ChickWeight").data (with offline fallback to bundled examples/chickweight.csv).
Cross-Skill Interface
Output:
├── code_r → .R script
├── code_python → .py script
├── figures/ → 2 PNGs (trajectories + interaction)
└── recommendations → text block (additional analyses available)
1---
2name: vera-stat-repeated-testing
3description: >-
4 Trajectory diagnostics and primary hypothesis tests for repeated measures /
5 longitudinal designs with a continuous outcome. Produces spaghetti plots with
6 group mean ribbons, ICC, descriptives per time point, attrition check, and
7 one interpreted test: paired t-test for 2 time points, repeated measures
8 ANOVA for 3+ time points in one group, or mixed ANOVA (time x group) for 3+
9 time points with 2+ groups, including Mauchly sphericity and Greenhouse-Geisser
10 correction. Ends with a recommendation block. Outputs .R and .py scripts with
11 publication-quality plots. Trigger when user has a continuous outcome measured
12 on the same subjects over time and says "repeated measures," "longitudinal,"
13 "within-subjects," "pre-post," "paired," "panel data," "growth curve,"
14 "multilevel," "mixed model," or "correlated observations." Does not handle
15 binary, count, survival, ordinal, or cross-sectional outcomes.
16user-invocable: true
17allowed-tools: Read, Bash, Write, Edit
18metadata:
19 source: https://skillmd.com/skills/aibot88/vera-stat-repeated-testing
20---
21
22# Repeated Measures Outcome — Trajectory Diagnostics & Hypothesis Testing
23
24Open-source skill.
25
26## Workflow
27
28Read each step file in `workflow/` before executing that step.
29
30| Step | File | Executor | Output |
31|---|---|---|---|
32| Collect | `workflow/01-collect-inputs.md` | Main Agent | Structured input summary |
33| Diagnose | `workflow/02-check-distribution.md` | Main Agent | PART 1 code block |
34| Test | `workflow/03-run-primary-test.md` | Main Agent | PART 2-3 code blocks |
35
36## Decision Tree
37
38```
391. DATA FORMAT CHECK
40 ├── Wide → reshape to long before proceeding
41 └── Long → continue
42
432. TIME POINTS
44 ├── Exactly 2 → paired comparisons path
45 └── 3+ → repeated measures ANOVA / mixed ANOVA path
46
473. GROUP STRUCTURE
48 ├── No between-subjects factor → one-way RM-ANOVA (within-subjects only)
49 └── Between-subjects factor → mixed ANOVA (time × group)
50
514. SPHERICITY (if 3+ time points)
52 ├── Mauchly p ≥ .05 → uncorrected F
53 └── Mauchly p < .05 → Greenhouse-Geisser / Huynh-Feldt correction
54```
55
56## Required Inputs
57
58| Role | What to collect |
59|---|---|
60| **Outcome (Y)** | Variable name, units, what it measures (continuous) |
61| **Time variable** | Measurement occasions, how many, equally spaced? |
62| **Subject/ID variable** | What identifies the same individual across time |
63| **Group variable** | Between-subjects factor (treatment, condition, etc.) |
64| **Covariates** | Time-varying? Time-invariant? |
65| **Data format** | Long (one row per obs) or wide (one row per subject) |
66
67## Code Structure
68
69```
70PART 0: Setup & Data Loading (+ reshape if wide)
71PART 1: Trajectory Diagnostics → plot_01_trajectories.png
72PART 2: Primary Hypothesis Test → plot_02_interaction.png
73PART 3: Recommendation Block → text listing additional analyses available
74```
75
76## Reporting Standards
77
781. p-values: "< .001" not "0.000"; exact to 3 decimals otherwise
792. Effect sizes: Cohen's d (paired t-test), partial eta-squared (RM-ANOVA/mixed ANOVA)
803. 95% CIs: always for mean differences
814. Degrees of freedom: always with t and F statistics
825. Sphericity: Mauchly's W, p; if violated, GG epsilon and corrected p
836. ICC: report value with interpretation
847. Sample size: final analytic N (subjects) and total observations
858. Decimal places: 2 for M/SD, 3 for p and effect sizes
869. Non-significance: "not statistically significant at alpha = .05" — never "no effect"
87
88## Hypothesis Tests
89
90| Scenario | Normal | Non-Normal |
91|---|---|---|
92| 2 time points (paired) | Paired t-test | Wilcoxon signed-rank |
93| 3+ time points, 1 group | One-way RM-ANOVA + sphericity | Friedman test |
94| 3+ time points, 2+ groups | Mixed ANOVA (time x group) | — |
95
96Cross-sectional group comparisons → `vera-stat-continuous-testing`.
97
98## Example Dataset
99
100R built-in `ChickWeight`: outcome = weight, time = Time (0, 2, 4, ..., 21 days),
101subject = Chick, group = Diet (1, 2, 3, 4).
102Python: `sm.datasets.get_rdataset("ChickWeight").data` (with offline fallback to bundled `examples/chickweight.csv`).
103
104## Cross-Skill Interface
105
106```
107Output:
108├── code_r → .R script
109├── code_python → .py script
110├── figures/ → 2 PNGs (trajectories + interaction)
111└── recommendations → text block (additional analyses available)
112```