Suggestion: Add Examples with Error(subject/(A*B)) for Repeated Measures in ARTool Documentation
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 66
- Forks
- 9
- PR merge metrics
- No merged PRs in 30d
Description
I’d like to propose adding examples for n-factor repeated measures designs using error terms like Error(subject/(A*B)), where A and B are fixed effects, to the official documentation:
https://cran.r-project.org/web/packages/ARTool/ARTool.pdf
To incorporate an error term, I tried the formula art(Y ~ A*B + Error(S), data = ElkinAB). While this syntax executes without issue, it seems to result in the invalid residual degrees of freedom for all main and interaction effects. This user behavior can potentially lead to invalid or misleading test results.
m <- art(Y~A*B + Error(S), ElkinAB)
anova(m)
Result:
Analysis of Variance of Aligned Rank Transformed Data
Table Type: Repeated Measures Analysis of Variance Table (Type I)
Model: Repeated Measures (aov)
Response: art(Y)
Error Df Df.res F value Pr(>F)
1 A Withn 1 21 561.556 <0.0000000000000002 ***
2 B Withn 1 21 14.372 0.001 **
3 A:B Withn 1 21 16.403 0.0006 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Result from Error(S/(A+B))
m <- art(Y~A*B + Error(S/(A*B)), ElkinAB)
anova(m)
Result:
Analysis of Variance of Aligned Rank Transformed Data
Table Type: Repeated Measures Analysis of Variance Table (Type I)
Model: Repeated Measures (aov)
Response: art(Y)
Error Df Df.res F value Pr(>F)
1 A S:A 1 7 379.050 0.0000002 ***
2 B S:B 1 7 24.155 0.002 **
3 A:B S:A:B 1 7 29.319 0.0009927 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Because of this, I believe such usage (i.e., Error(S)) should either be discouraged or clearly explained in case of repeated measures design. Therefore, I suggest including an example using Error(subject/(A*B)).
Currently, the documentation provides a repeated measures example only via a linear mixed-effects model (lmer) with (1|S). Including a parallel example using
Error(subject/(A*B)) would be highly useful for those not working with mixed models.
Could you consider adding such an example or clarifying this behavior in the documentation? I’d appreciate any feedback.
Thank you!
Related Links
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the repeated-measures section of the ARTool.pdf documentation and compare its existing lmer example with the reported Error(S) and Error(S/(A*B)) formulas using the ElkinAB example. Confirm the degrees-of-freedom behavior, then document whether Error(S) should be discouraged and add or clarify the repeated-measures example. Done means the guidance addresses the misleading result and shows the appropriate error-term usage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100