question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Comparing self-subsetting models

See original GitHub issue

I was wondering if pymer4 has a way to compare two models varying in the presence/absence of a given variable in the formula. In R, this can be easily done with the command anova(). E.g.:

model1 <- lmer(DV + IV1 + (IV1 | Group), data=data)
model2 <- lmer(DV + IV1*IV2 + (IV1 + IV2 | Group), data=data)

anova(model1, model2)

The command Lmer.anova() in pymer4 does not seem to do the same, though. Is there a way to accomplish this?

P.S.: I am aware this is not a “bug” properly said, but opening a bug issue on Githus seems to be the only way to get in touch with the developers to ask this. Thanks!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
dramanicacommented, Aug 3, 2022

@ejolly Actually, I had a bit of spare time, so tests are now fully implemented. Whilst I was at it, I also added a wrapper to confint for the Lmer class, so that it is now possible to bootstrap and profile the variances of the random components. It’s an additional feature that I will need to use pymer4 in a course I plan to teach next year.

1reaction
ejollycommented, Feb 9, 2021

Unfortunately not at this time. It’s on the short term todo list, so some time this year given my work commitments: https://trello.com/c/XOxtVjX0

I had started this functionality with the hope to compute it in pure Python rather than relying on R calls to keep things a bit speedy as can be seen in this commented code on the master branch: https://github.com/ejolly/pymer4/blob/master/pymer4/stats.py#L552

And this utility function: https://github.com/ejolly/pymer4/blob/master/pymer4/utils.py#L460

If memory serves, I wasn’t quite getting matching results with R and I’m sure some of the stats are probably being computed incorrectly and may end up requiring an R call.

Always happy to receive code contributions as PRs!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to compare regression models - Duke People
After fitting a number of different regression or time series forecasting models to a given data set, you have many criteria by which...
Read more >
3.7 Comparing Models Using the Training Set
This approach can be used to compare models or different approaches for the same model (e.g., preprocessing differences or feature sets). The value...
Read more >
Comparing Model Evaluation Techniques Part 3: Regression ...
In this post, I'll take a look at how you can compare regression models. Comparing regression models is perhaps one of the trickiest...
Read more >
TAGS · version-1.02b · Naps / naps · GitLab
bool selfSubset( 1608,56799. 325. macro bool selfSubset( 1627,57312 ... vec<lbool> model; Solver::model 221,10283. 459. int verbosity; Solver::verbosity 222 ...
Read more >
Model Comparisons | stats-jedi.knit - QuantPsych
So, in short, this function will visually compare two models. In the plot above, one in blue is the reduced model and the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found