Rob Cavanaugh's Avatar

Rob Cavanaugh

@rbcavanaugh.bsky.social

Assistant Professor in quantitative methods @mghinstitute, speech-language pathologist by training. Enthusiastic about quantitative methods in rehabilitation research and health services research for aphasia. ๐Ÿฅพ๐Ÿ”๏ธ๐Ÿฆฎ๐Ÿ•

444 Followers  |  514 Following  |  71 Posts  |  Joined: 02.12.2023  |  1.8942

Latest posts by rbcavanaugh.bsky.social on Bluesky

Preview
How I, a non-developer, read the tutorial you, a developer, wrote for me, a beginner - annie's blog โ€œHello! I am a developer. Here is my relevant experience: I code in Hoobijag and sometimes jabbernocks and of course ABCDE++++ (but never ABCDE+/^+ are you kidding? ha!)  and I like working with ...

"How I, a non-developer, read the tutorial you, a developer, wrote for me, a beginner" by Annie Mueller ๐Ÿ˜… ๐Ÿ˜‚ ๐Ÿ˜ญ

anniemueller.com/posts/how-i-...

23.09.2025 07:57 โ€” ๐Ÿ‘ 324    ๐Ÿ” 95    ๐Ÿ’ฌ 15    ๐Ÿ“Œ 30

So I should just ask students to explain each meme for their stats midterm right?

17.09.2025 15:05 โ€” ๐Ÿ‘ 2    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0
Post image

Join us Monday, September 15th from 4:00 pm to 5:00 pm ET for a talk by Simona Mancini, Ikerbasque Research Associate Professor / Neurolinguistics and Aphasia group leader at the Basque Center on Cognition Brain and Language.

Register now at https://bit.ly/45LjrF1

03.09.2025 15:15 โ€” ๐Ÿ‘ 8    ๐Ÿ” 3    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

fantastic! Straight into the reading list for graduate stats. One thing that might be useful is a conceptual paragraph about how statistical power/sample size estimation changes. I can imagine (enthusiastic) students stuck on how to adjust what they know about study planning.

26.08.2025 14:07 โ€” ๐Ÿ‘ 2    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0
Models as Prediction Machines: How to Convert Confusing Coefficients into Clear Quantities

Abstract
Psychological researchers usually make sense of regression models by interpreting coefficient estimates directly. This works well enough for simple linear models, but is more challenging for more complex models with, for example, categorical variables, interactions, non-linearities, and hierarchical structures. Here, we introduce an alternative approach to making sense of statistical models. The central idea is to abstract away from the mechanics of estimation, and to treat models as โ€œcounterfactual prediction machines,โ€ which are subsequently queried to estimate quantities and conduct tests that matter substantively. This workflow is model-agnostic; it can be applied in a consistent fashion to draw causal or descriptive inference from a wide range of models. We illustrate how to implement this workflow with the marginaleffects package, which supports over 100 different classes of models in R and Python, and present two worked examples. These examples show how the workflow can be applied across designs (e.g., observational study, randomized experiment) to answer different research questions (e.g., associations, causal effects, effect heterogeneity) while facing various challenges (e.g., controlling for confounders in a flexible manner, modelling ordinal outcomes, and interpreting non-linear models).

Models as Prediction Machines: How to Convert Confusing Coefficients into Clear Quantities Abstract Psychological researchers usually make sense of regression models by interpreting coefficient estimates directly. This works well enough for simple linear models, but is more challenging for more complex models with, for example, categorical variables, interactions, non-linearities, and hierarchical structures. Here, we introduce an alternative approach to making sense of statistical models. The central idea is to abstract away from the mechanics of estimation, and to treat models as โ€œcounterfactual prediction machines,โ€ which are subsequently queried to estimate quantities and conduct tests that matter substantively. This workflow is model-agnostic; it can be applied in a consistent fashion to draw causal or descriptive inference from a wide range of models. We illustrate how to implement this workflow with the marginaleffects package, which supports over 100 different classes of models in R and Python, and present two worked examples. These examples show how the workflow can be applied across designs (e.g., observational study, randomized experiment) to answer different research questions (e.g., associations, causal effects, effect heterogeneity) while facing various challenges (e.g., controlling for confounders in a flexible manner, modelling ordinal outcomes, and interpreting non-linear models).

Figure illustrating model predictions. On the X-axis the predictor, annual gross income in Euro. On the Y-axis the outcome, predicted life satisfaction. A solid line marks the curve of predictions on which individual data points are marked as model-implied outcomes at incomes of interest. Comparing two such predictions gives us a comparison. We can also fit a tangent to the line of predictions, which illustrates the slope at any given point of the curve.

Figure illustrating model predictions. On the X-axis the predictor, annual gross income in Euro. On the Y-axis the outcome, predicted life satisfaction. A solid line marks the curve of predictions on which individual data points are marked as model-implied outcomes at incomes of interest. Comparing two such predictions gives us a comparison. We can also fit a tangent to the line of predictions, which illustrates the slope at any given point of the curve.

A figure illustrating various ways to include age as a predictor in a model. On the x-axis age (predictor), on the y-axis the outcome (model-implied importance of friends, including confidence intervals).

Illustrated are 
1. age as a categorical predictor, resultings in the predictions bouncing around a lot with wide confidence intervals
2. age as a linear predictor, which forces a straight line through the data points that has a very tight confidence band and
3. age splines, which lies somewhere in between as it smoothly follows the data but has more uncertainty than the straight line.

A figure illustrating various ways to include age as a predictor in a model. On the x-axis age (predictor), on the y-axis the outcome (model-implied importance of friends, including confidence intervals). Illustrated are 1. age as a categorical predictor, resultings in the predictions bouncing around a lot with wide confidence intervals 2. age as a linear predictor, which forces a straight line through the data points that has a very tight confidence band and 3. age splines, which lies somewhere in between as it smoothly follows the data but has more uncertainty than the straight line.

Ever stared at a table of regression coefficients & wondered what you're doing with your life?

Very excited to share this gentle introduction to another way of making sense of statistical models (w @vincentab.bsky.social)
Preprint: doi.org/10.31234/osf...
Website: j-rohrer.github.io/marginal-psy...

25.08.2025 11:49 โ€” ๐Ÿ‘ 944    ๐Ÿ” 283    ๐Ÿ’ฌ 48    ๐Ÿ“Œ 19

Oooh and what does the AI boilerplate section look like?

23.08.2025 19:22 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

This is such a thorough study - what a great example of quality science putting an existing paradigm up to a rigorous test. A-priori power analysis. Preregistered. Open data and code. You can tell the authors made sure to anticipate every โ€œbut what ifโ€ฆโ€ response to the null evidence.

19.08.2025 18:20 โ€” ๐Ÿ‘ 3    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

Sounds a little viffy

18.08.2025 23:11 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0
Preview
GitHub - rbcavanaugh/toddler: Base R Functions to Mess Up Clean Data for Teaching Base R Functions to Mess Up Clean Data for Teaching - rbcavanaugh/toddler

This is awesome! In a weird coincidence I created something similar a few weeks (github.com/rbcavanaugh/..., mostly with Claude because Iโ€™m course prepping 2.5 courses and have enough to do already). Iโ€™m glad someone has created something with a bit more intention.

18.08.2025 21:29 โ€” ๐Ÿ‘ 6    ๐Ÿ” 1    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

And where might be put multicolinearity on this figure? ๐Ÿ›‹๏ธ๐Ÿฟ

18.08.2025 21:05 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 2    ๐Ÿ“Œ 0

This is fantastic!

There is something funky - I get the error โ€œcould not find function is_null()โ€. Looks like itโ€™s an rlang export?

22.07.2025 15:40 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0
Preview
Within-person factorial experiments, log(normal) reaction-time data | A. Solomon Kurz Causal inference with the GLMM, Part 1

New #rstats blog up!

solomonkurz.netlify.app/blog/2025-07...

This is the first in a new series discussing causal inference with experimental data using multilevel models. My basic case is g-computation is the way to go.

21.07.2025 14:14 โ€” ๐Ÿ‘ 98    ๐Ÿ” 20    ๐Ÿ’ฌ 7    ๐Ÿ“Œ 1
Preview
Which Kind of Science Reform What hope is there for science reform, if we can't agree on what to reform? Right now, principles are more important than practices.

How can we reform science? I have some ideas. But I am not sure youโ€™ll like them, because they donโ€™t promise much. elevanth.org/blog/2025/07...

09.07.2025 13:40 โ€” ๐Ÿ‘ 276    ๐Ÿ” 132    ๐Ÿ’ฌ 16    ๐Ÿ“Œ 44
Post image Post image

So grateful for this amazing work! Very timely presenting on guideline adherence at CAC weeks ago. Hereโ€™s guideline adherence to 2 of your guidelines in US community based care (Red=not adherent). Many assumptions but I suspect a reasonable approximation.

13.06.2025 03:46 โ€” ๐Ÿ‘ 2    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0
a scatterplot showing that folks with kids who spend enough days on vacation achieve unheard of levels of relaxation.

a scatterplot showing that folks with kids who spend enough days on vacation achieve unheard of levels of relaxation.

(for the record, love the latter scenario where if you spend long enough on vacation, and you have kids, you might enter a sort of relaxation enlightenment)

12.05.2025 02:11 โ€” ๐Ÿ‘ 5    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

gets messy where

relaxation = ifelse(relaxation < median(relaxation), 0, 1) ?

or something like:

exp((1 - kids)*1*vacation) ?

(amazing by the way...I think I might need to go re-run some old models)

12.05.2025 02:09 โ€” ๐Ÿ‘ 2    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

I love this take but Iโ€™m skeptical this is a pervasive view (at least in my subfield). curriculum, practice, and reviewers all take a lot of take time to change behavior

06.05.2025 13:33 โ€” ๐Ÿ‘ 2    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

Yes! Modelbased and parameters are part of my standard workflow. So simple to put the formatted output in a flextable โ€”> word doc or reference output using inline syntax to automate results sections. Saves me loads of time and reduces manual errors.

06.05.2025 12:07 โ€” ๐Ÿ‘ 3    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

Wow I had no idea. Thanks!!

06.05.2025 11:52 โ€” ๐Ÿ‘ 2    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

Ah I remember that post! Yes I think perhaps something like reducing contrasts to treatment and effects coding, noting others exist, and moving on to marginal effects might be a good compromise.

06.05.2025 11:52 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0
Contrasts

Essentially, most of this: debruine.github.io/faux/article...

06.05.2025 11:27 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 4    ๐Ÿ“Œ 0

Sooo I should just swap out my lectures on contrasts for marginal effects right??

06.05.2025 11:14 โ€” ๐Ÿ‘ 4    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

I think Ellyn Riley is/was recently looking for a post doc

10.04.2025 17:48 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0
Post image

Had a great time sharing about our test-retest, #multimodal #communication #aphasia & peer dataset at the University of Technology Sydney Graduate School of Health seminar series today. Join AphasiaBank (totally free) and get full access to our data! aphasia.talkbank.org/access/Engli...

08.04.2025 10:42 โ€” ๐Ÿ‘ 8    ๐Ÿ” 4    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0
Preview
a cartoon of homer simpson holding a card ALT: a cartoon of homer simpson holding a card

Funding curves for K and F mechanisms

(Warning: the new F mechanism "curve" is a lot)

29.03.2025 12:56 โ€” ๐Ÿ‘ 114    ๐Ÿ” 59    ๐Ÿ’ฌ 5    ๐Ÿ“Œ 7

Hey #rstats friends. Iโ€™m looking for examples of papers or posts that do a really really good job unpacking/writing about/explaining statistical results. Not just technically correct but also clear. Bonus points for using marginal effects. Whatโ€™s your go to exemplar for students new to research?

26.03.2025 12:58 โ€” ๐Ÿ‘ 6    ๐Ÿ” 3    ๐Ÿ’ฌ 2    ๐Ÿ“Œ 0

Amazing thanks!

23.03.2025 16:42 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

Iโ€™ve made this point but rarely do revisions address the issue. Usually authors back off causal phrasing (โ€œweโ€™re just looking at associations so this doesnโ€™t applyโ€). Or the authors arenโ€™t familiar with causal inference ideas and itโ€™s not a helpful reference. How do you usually frame your comment?

23.03.2025 12:54 โ€” ๐Ÿ‘ 3    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0
Preview
Reviewer notes: Thatโ€™s a very nice mediation analysis you have there. It would be a shame if something happened to it. Mediation analysis has gotten a lot of flak, including classic titles such as โ€œYes, but whatโ€™s the mechanism? (Donโ€™t expect an easy answer)โ€ (Bullock et al., 2010), โ€œWhat mediation analysis can (not) ...

New blog post! In which I explain the issue with mediation analysis and sketch out one way to deal with the underlying causal inference problem -- in just a bit over 1,000 words!

If you have never found the time to read up on this, now is your chance.

www.the100.ci/2025/03/20/r...

20.03.2025 13:40 โ€” ๐Ÿ‘ 455    ๐Ÿ” 138    ๐Ÿ’ฌ 27    ๐Ÿ“Œ 20

Cool! Were you just playing choose your own adventure everyday via dice roll?

07.03.2025 23:40 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

@rbcavanaugh is following 20 prominent accounts