check_model() on more brms families

Open
#461 4 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
38/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
r
Domain
data

Research direction

Start by reproducing the shifted_lognormal brms example with performance::check_model(), then inspect the check_model() and related model-family handling entry points. Compare the failing check_model() and check_homogeneity() paths with the working check_predictions() and check_outliers() calls; done means supported families no longer error and regression coverage exists for the reported case.

Written by the indexing model from the issue text.

Description

Enhancement :boom:

Currently check_model() errors on some families, even though some plot could be produced (at least, a PP check)

m <- brms::brm(wt ~ mpg * hp, family = "shifted_lognormal", data = mtcars, refresh = 0)
#> Compiling Stan program...
#> Start sampling

# Doesn't work :'(
performance::check_model(m)
#> Error in get(family$family): object 'shifted_lognormal' not found

# Works
plot(performance::check_collinearity(m))
#> Warning: Model has interaction terms. VIFs might be inflated. You may check
#>   multicollinearity among predictors of a model without interaction terms.

# plot(performance::check_heteroscedasticity(m))

# Works
performance::check_predictions(m)
#> Using 10 posterior draws for ppc type 'dens_overlay' by default.


# Doesn't work
performance::check_homogeneity(m)
#> Error in bartlett.test.default(x = mf[[1L]], g = mf[[2L]]): there must be at least 2 observations in each group

# Works
plot(performance::check_outliers(m))

Created on 2022-08-06 by the reprex package (v2.0.1)

Dominant language
R
Stars
1.2k
Forks
113
Avg merge
9h 8m
Merged PRs (30d)
27

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from easystats/performance

All issues in easystats/performance

Similar issues

More R issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.