stan_lm gives estimates for only two of the three levels below (‘A’ and ‘B’), and ignores ‘C’. Any clues why?
library(tidyverse)
library(rstanarm)
df <- tribble(
~nm, ~ft,
"A", 122.0,
"A", 121.0,
"B", 120.0,
"B", 119.0,
"C", 116.0,
"C", 118.0
)
lm(ft ~ 0 + nm, data = df) %>% summary() # gives estimates for A, B and C
stan_lm(ft ~ 0 + nm, prior = NULL, data = df) %>% summary() # gives estimates for A and B only. Why not C?
If possible, add also code to simulate data or attach a (subset of) the dataset you work with.
- Operating System: R version 4.0.4 (2021-02-15)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Big Sur 10.16 - rstanarm Version: rstanarm_2.21.1