Provide option to use Satterthwaite’s approximation
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 66
- Forks
- 9
- PR merge metrics
- No merged PRs in 30d
Description
This package uses function car::Anova() that implements Kenward-Roger's approximation (KR) to find the degrees of freedom in mixed-effects models. KR could be very slow for a large number of data points. The implementation of KR in the car package is slower than the implementation in the pbkrtest package.
This issue could causes ART to behave strangely from the users' perspective
- Assigning
art()result to a variable is working as expected. - However, printing that variable (or directly calling
art()without assigning the result to any variable) becomes unresponsive. This was because printing anartobject also runs ANOVA behind the scene.
Luke (2017) found that KR and Satterthwaite’s approximation are comparable in terms of Type 1 error. Satterthwaite's method is less time-consuming.
I suggest the following:
- Replace the call to
car::Anova()with a call tolmerTest::anova(). The latter function uses KR from thepbkrtestpackage that is a bit faster than thecarpackage. From the current implementation of theARTool, I extracted the model usingartlm()and convert it tolmerModLmerTestclass before callinganova():
art_result <- art(y ~ x1 * x2 + (1 | id), data = df_wpm_bkgnd)
m_art_typing_style <-
artlm(art_result, "x1") %>%
as_lmerModLmerTest()
anova(m_art_typing_style, ddf= "Kenward-Roger")
- Allow the user to pass a parameter to choose the approximation method when call
art() - Set the default approximation method to Satterthwaite's. This is done by using the
"Satterthwaite"for theddfparameter above.
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 by tracing how art() printing invokes ANOVA through the current car::Anova() path, then compare the artlm() and lmerTest::anova() flow described in the issue. The work is done when users can choose the degrees-of-freedom approximation in art(), with Satterthwaite as the default, without breaking existing ANOVA behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- data
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100