Sign in

Mattan S. Ben-Shachar

@mattansb.msbstats.info
3.7K followers 410 following 2.5K posts

Statistics lecturer | Freelance statistical consultant & research analyst | #rstats dev @easystats.github.io home.msbstats.info (He/Him)

PostsRepliesMedia
Mattan S. Ben-Shachar @mattansb.msbstats.info · 06/10/2026
Maybe for applied science you can make this case - but overall, knowledge production _is_ the outcome of science. I think the discussions in the maths now around what LLMs can do are very enlightening. I also like this paper: arxiv.org/pdf/2602.10181
130
Mattan S. Ben-Shachar @mattansb.msbstats.info · 03/10/2026
130
Mattan S. Ben-Shachar @mattansb.msbstats.info · 01/10/2026
Me: Wait, why are you performing a cluster analysis? Student: I want to describe the data in a lower dimensional setting. Me: How many dimensions do you have? Student: 4, but the clustering seems to only be sensitive to 2. Me: And you're getting how many clusters...? Student: 3. Me: ...
1100
Mattan S. Ben-Shachar @mattansb.msbstats.info · 24/09/2026
Code:
"%?%" <- function(test, yes) {
  stop(
    "%?% should only be called as part of the a sequence:\n",
    "  test %?% yes %:% no",
    call. = FALSE
  )
}

"%:%" <- function(testyes, no) {
  cl2 <- match.call()
  cl1 <- cl2$testyes

  if (
    !(length(cl2) == 3L &&
      length(cl1) == 3L &&
      cl2[[1]] == "%:%" &&
      cl1[[1]] == "%?%")
  ) {
    stop(
      "%:% should only be called as part of the a sequence:\n",
      "  test %?% yes %:% no",
      call. = FALSE
    )
  }

  cl1[[1]] <- quote(vctrs::vec_if_else)
  cl1[[4]] <- cl2$no
  eval.parent(cl1)
}
170
Mattan S. Ben-Shachar @mattansb.msbstats.info · 24/09/2026
I love #rstats Yes, this is just syntactic sugar (and probably not very useful) but this was fun to figure out with infix operators 😎
4261
Mattan S. Ben-Shachar @mattansb.msbstats.info · 24/09/2026
From the same chapter in the book - it's almost brutal!
3140
Mattan S. Ben-Shachar @mattansb.msbstats.info · 24/09/2026
This quote by haunts me. From Wilcox's "Introduction to Robust Estimation and Hypothesis Testing" #stats
To begin, distributions are never normal. For some this seems obvious, hardly worth mentioning, but an aphorism given by Cram´er (1946) and attributed to the mathematician Poincar´e remains relevant: “Everyone believes in the [normal] law of errors, the experimenters because they think it is a mathematical theorem, the mathematicians because they think it is an experimental fact.”
310422
Mattan S. Ben-Shachar @mattansb.msbstats.info · 19/09/2026
"Don't touch that!" "Put that down!" "You're going to break that!" "Where did you find that?" "Get off of that!" ...
160
Mattan S. Ben-Shachar @mattansb.msbstats.info · 19/09/2026
Oh look, there are too many papers*! No one to read them all! Surely this here canister of gasoline will put out this fire! (LLMs' role in exacerbating this is left as an exercise for the reader...)
1100
Mattan S. Ben-Shachar @mattansb.msbstats.info · 18/09/2026
083
Mattan S. Ben-Shachar @mattansb.msbstats.info · 16/09/2026
Time to update my "AI is bad for learning, actually" slides... *sigh*
080
Mattan S. Ben-Shachar @mattansb.msbstats.info · 14/09/2026
Upgrading my "hedghog-cake as an estimand" slide with some more hedgehog cakes from hell. #statsmeme
4588
Mattan S. Ben-Shachar @mattansb.msbstats.info · 09/09/2026
Clearly she's never seen a pangolin!
070
Mattan S. Ben-Shachar @mattansb.msbstats.info · 06/09/2026
Great minds #statsmeme
050
Mattan S. Ben-Shachar @mattansb.msbstats.info · 02/09/2026
Also, related shoutout to #rstats raw string syntax: r"( STUFF )" stat.ethz.ch/R-manual/R-d...
0100
Mattan S. Ben-Shachar @mattansb.msbstats.info · 31/08/2026
I had Claude write it up for me. Soon to me on CRAN, obviously.
041
Mattan S. Ben-Shachar @mattansb.msbstats.info · 31/08/2026
Okay, but hear me out...
An R function called trenchcoat that converts 3 correlations into...

trenchcoat(rxy = , rxm = , rmy = , N = )
1122
Mattan S. Ben-Shachar @mattansb.msbstats.info · 27/08/2026
No, I don't think that's right... A spork is a spoon with a fork tip. So a foon would be...
A spork and a foon.
230
Mattan S. Ben-Shachar @mattansb.msbstats.info · 26/08/2026
#statsmeme
3121
Mattan S. Ben-Shachar @mattansb.msbstats.info · 18/08/2026
Gemini out here doing the lord's work.
120
Mattan S. Ben-Shachar @mattansb.msbstats.info · 13/08/2026
#statsmeme
3153
Mattan S. Ben-Shachar @mattansb.msbstats.info · 03/08/2026
#statsmeme
1101
Mattan S. Ben-Shachar @mattansb.msbstats.info · 31/07/2026
Idk man... Very sus...
030
Mattan S. Ben-Shachar @mattansb.msbstats.info · 31/07/2026
Want to write a paper together introducing the new ODD (odd differences delta)? Title: Isn't that ODD? Bridging the gap between odds ratios and risk differences.
library(marginaleffects)

mod <- glm(
  am ~ vs,
  family = binomial("logit"),
  data = mtcars
)

odds <- avg_predictions(
  mod,
  variables = "vs",
  type = "response",
  transform = effectsize::probs_to_odds
)

# odds difference
hypotheses(odds, hypothesis = difference ~ pairwise)
162
Mattan S. Ben-Shachar @mattansb.msbstats.info · 28/07/2026
A client thought up some BS with Claude and sent me the full report + analysis code, all 100% written and run and interpreted by Claude. I gave a detailed response explaining why it was trash, which my client (for laughs) forwarded to Claude. Claude was not happy being criticized.
3110
Mattan S. Ben-Shachar @mattansb.msbstats.info · 21/07/2026
I meant in the sense that (1 | g) is captured in (1 | g:f), it think? Like, any differences in subject-means are also modelled in the differences between subject-condition-means, no?
100
Mattan S. Ben-Shachar @mattansb.msbstats.info · 20/07/2026
While I'm here, 🧵 rant: People talking about how their paper was improved by Peer Review™ often fail to consider how much better it was, how much effort (time, actual money, opportunity) was wasted for these diminishing returns, and how often papers are actually WORSE following Peer Review™. 2/
2120
Mattan S. Ben-Shachar @mattansb.msbstats.info · 15/07/2026
Clearly written before LLMs - now everyone is an expert in a matter of *minutes*!
160
Mattan S. Ben-Shachar @mattansb.msbstats.info · 09/07/2026
Rewatching Community, John Oliver (the psychology professor) is channeling how we all feel when data misbehaves... #stats
2132
Mattan S. Ben-Shachar @mattansb.msbstats.info · 07/07/2026
The Hallgrímskirkja church is very heavy tailed... #rstats #ggplot2
library(ggplot2)
library(distributional)
library(ggdist)
library(ggfx)

update_geom_defaults("slab", aes(fill = NA, linewidth = 1, alpha = 0.7))

img <- jpeg::readJPEG("msid-44847844,width-96,height-65-499916619.jpg")

p <- ggplot() +
  annotation_raster(img, xmin = -9.5, xmax = 9.5, ymin = -0.2, ymax = 1.07) +
  geom_hline(yintercept = 0, color = "black", linewidth = 1) |>
    with_outer_glow("white") +
  stat_slab(aes(xdist = dist_cauchy(0, 1), color = "Cauchy"), n = 10001) |>
    with_outer_glow("white") +
  stat_slab(aes(xdist = dist_laplace(0, 1), color = "Laplace")) |>
    with_outer_glow("white") +
  stat_slab(aes(
    xdist = dist_student_t(3, 0, 1),
    color = "Student t (df = 3)"
  )) |>
    with_outer_glow("white") +
  stat_slab(
    aes(xdist = dist_normal(0, 1), color = "Std. Normal"),
    p_limits = c(.000000001, .999999999)
  ) |>
    with_outer_glow("white") +
  coord_fixed(
    ratio = (19 / 1.27) / (1024 / 683),
    xlim = c(-8, 8),
    ylim = c(-0.1, 1),
    expand = c(0, 0)
  ) +
  scale_color_viridis_d(
    NULL,
    limits = rev(c("Cauchy", "Student t (df = 3)", "Laplace", "Std. Normal"))
  ) +
  labs(
    title = "Which distribution best fits the Hallgrímskirkja church facade?",
    x = expression(theta),
    y = NULL
  ) +
  theme_minimal() +
  theme_sub_axis_left(text = element_blank(), ticks = element_blank())

ggsave(
  "church.png",
  p,
  width = 11,
  height = 7,
  units = "cm",
  dpi = 600,
  scaling = 1 / 1.8
)
2386
Mattan S. Ben-Shachar @mattansb.msbstats.info · 05/07/2026
Playing around with Google's notebookLM. Asked for a video summary of my class on objective priors, where I explained how flat priors are counterproductive in many cases. The result is basically making the opposite point... 😬 #stats #bayes
272
Mattan S. Ben-Shachar @mattansb.msbstats.info · 01/07/2026
"... so you can spend time on science." What does Anthropic think "doing science" *is*?? claude.com/product/clau...
3304
Mattan S. Ben-Shachar @mattansb.msbstats.info · 19/06/2026
There are apparently two Mattan S. Ben-Shachars in the weights! (They're both me...)
250
Mattan S. Ben-Shachar @mattansb.msbstats.info · 15/06/2026
#statsmeme? (Prompted by a conversation with a student who's double majoring in stats-econ and said that stats courses make more sense to him)
23911
Mattan S. Ben-Shachar @mattansb.msbstats.info · 15/06/2026
Accidentally color coordinated with my slides yesterday 🤭 (The actual colors were blue and green, but thanks to the projector being old, my students got a good laugh)
1200
Mattan S. Ben-Shachar @mattansb.msbstats.info · 09/06/2026
1131
Mattan S. Ben-Shachar @mattansb.msbstats.info · 07/06/2026
1473
Mattan S. Ben-Shachar @mattansb.msbstats.info · 02/06/2026
The {tidymodels} hex sticker for the {censored} package is perfect 😂 (but also, I'm a little uncomfortable?)
120
Mattan S. Ben-Shachar @mattansb.msbstats.info · 31/05/2026
Psychologists doing exploratory factor analysis be like: #statsmeme
611616
Mattan S. Ben-Shachar @mattansb.msbstats.info · 31/05/2026
Psychologists doing clustering be like: #statsmeme
940763
Mattan S. Ben-Shachar @mattansb.msbstats.info · 31/05/2026
Difference scores strike again! Here are those results on the full scales - what's really going on is that all religions (inc. atheism and agnostism) excluding JW should be left but also joined (??).
382
Mattan S. Ben-Shachar @mattansb.msbstats.info · 29/05/2026
At least 2500! #statsmeme
1365
Mattan S. Ben-Shachar @mattansb.msbstats.info · 29/05/2026
1164
Mattan S. Ben-Shachar @mattansb.msbstats.info · 27/05/2026
#statsmeme
2271
Mattan S. Ben-Shachar @mattansb.msbstats.info · 27/05/2026
I can't be the only one who hears this, right? #statsmeme
5409
Mattan S. Ben-Shachar @mattansb.msbstats.info · 26/05/2026
Is that so?
120
Mattan S. Ben-Shachar @mattansb.msbstats.info · 20/05/2026
I was wondering how "DAG" would be pronounced with an Australian accent, and this somehow let me to remember the greatest accent ever depicted in film... #statsmeme
092
Mattan S. Ben-Shachar @mattansb.msbstats.info · 19/05/2026
The vignette also introduces the (improved) Bayes factor matrices to compare between all the models, examples of using {bayestestR} with #marginaleffects and #emmeans, demo for setting priors on factor encodings, ...
100
Mattan S. Ben-Shachar @mattansb.msbstats.info · 19/05/2026
🚨NEW-ish VIGNETTE ALERT🚨 The Bayes factor vignette for {bayestestR} has been completely re-written! We've got all the BFs! - Marginal likelihoods - Model & posterior averaging - Order restrictions - Savage-Dickey density ratios AND MORE! Read it up, here: @easystats.github.io #Bayes #rstats
2285
Mattan S. Ben-Shachar @mattansb.msbstats.info · 18/05/2026
I just can't help myself sometimes. I need to apologize to my students that were subjected to this silliness today... #statsmeme #Bayes
161