Question: model_parameters() for stanreg (from rstanarm::stan_lmer) and brmsfit (brms::brm) not complete?

Aperta
#1,271 6 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@jmgirard ci sta già lavorando.

Dal 29/11/2026.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
52/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
r
Ambito
backend, data

Direzione di ricerca

The report compares model_parameters() output for lmer, stan_lmer, and brm fits, including calls with effects = "random_variance"; start by tracing how those model classes and effects are handled. Check the existing model_parameters.brmsfit support and relevant tests, then reproduce the reported missing group and residual standard deviations and footer labels. Done means the output handles the reported models and includes the expected estimates and labels.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Bug :bug:

Hello, I am not quite sure if I am missing something, or if the output I'm looking for is itself missing. It looks like model_parameters is not set up to specifically handle stanreg objects, though it is set up to handle brmsfit objects. My layman's way of seeing this is to type > ?model_parameters and scroll through the list to see model_parameters.brmsfit but no model_parameters.stanreg. I assume that's sufficient, but no doubt there's better ways. I included a model fit with lmer for comparison.

When running the code below, model_parameters is able to extract:
lmer: gives the SD_groups (35.75) and SD_residual (44.26) estimates, the footer also has SD_residual (Sigma) and RMSE
brm: gives the SD_residual ("sigma" 44.42) but no SD_groups. Also what is R2 and Marginal-R2 are missing labels in the footer.
stan_lmer: does not give either SD_groups or SD_residual. Same footer missing labels issue as brm.

Please let me know if I am doing something incorrectly, or if what I think should be there really is missing. Thanks.


library(lme4)
library(rstanarm)
library(brms)
library(easystats)

head(sleepstudy)

fit_lmer1 <- lmer(Reaction ~ 1 + (1|Subject), data = sleepstudy)
fit_stan_lmer1 <- stan_lmer(Reaction ~ 1 + (1|Subject), data = sleepstudy)
fit_brm1 <- brm(Reaction ~ 1 + (1|Subject), data = sleepstudy, backend = "cmdstanr")

model_parameters(fit_lmer1, include_info = TRUE)
model_parameters(fit_stan_lmer1, include_info = TRUE)
model_parameters(fit_brm1, include_info = TRUE)

model_parameters(fit_stan_lmer1, include_info = TRUE, effects = "random_variance")
model_parameters(fit_brm1, include_info = TRUE, effects = "random_variance")

Lingua principale
R
Stelle
502
Fork
47
Merge medio
17h 59m
PR unite (30g)
10

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di easystats/parameters

Tutte le issue di easystats/parameters

Issue simili

Altre issue su R

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.