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

Abierto
#1,271 6 comentarios 0 reacciones 1 asignado Ver en GitHub

Los mantenedores suelen responder en 1 día

@jmgirard ya está trabajando en esto.

Desde el 29/11/2026.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
52/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
r
Área
backend, data

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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")

Lenguaje dominante
R
Estrellas
502
Forks
47
Merge medio
17 h 59 min
PR fusionados (30 d)
10

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de easystats/parameters

Todos los issues de easystats/parameters

Issues similares

Más issues de R

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.