Noah Greifer's Avatar

Noah Greifer

@noahgreifer.bsky.social

Statistical consultant and programmer at Harvard IQSS. Author/maintainer of the #Rstats packages 'MatchIt', 'WeightIt', and 'cobalt' for causal inference, among many others | He/him ngreifer.github.io

3,776 Followers  |  173 Following  |  417 Posts  |  Joined: 20.09.2023  |  2.4922

Latest posts by noahgreifer.bsky.social on Bluesky

x[c(2,5,9),] identifies the submatrix

00
AD
00
00
BE
00
00
00
CF
00

R fills in matrices by column (alphabetically above), recycling the vector 1:2 as needed (in this case 3 times to fill 6 spots.

So we get A = 1, B = 2, C = 1, D = 2, E = 1, F = 2.

29.11.2025 04:33 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

I TA'd for John at ICPSR in 2017. He was very supportive of me early on in my career and so inspiring as someone bridging statistics education, methodological research, and statistical computing. He is certainly a giant whose shoulders I am honored to stand on.

28.11.2025 16:47 β€” πŸ‘ 16    πŸ” 2    πŸ’¬ 0    πŸ“Œ 0

sprintf() is pretty close

26.11.2025 13:14 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

Do you mean "immortal time bias"? Definitely one of the coolest named biases

25.11.2025 17:17 β€” πŸ‘ 6    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

"The probability that there is no effect is the same as the probability of flipping 7 heads in a row"

See, I can misinterpret S-values, too

25.11.2025 16:03 β€” πŸ‘ 10    πŸ” 0    πŸ’¬ 1    πŸ“Œ 1

Any #rstats advice for writing mathematical expressions in ggplot2 axis labels? Dying not to have to use the insanity that is bquote()

13.11.2025 21:57 β€” πŸ‘ 8    πŸ” 2    πŸ’¬ 1    πŸ“Œ 0

I could have bootstrapped the whole thing and it still would have been quicker!

04.11.2025 20:26 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

What do you mean my Bayesian logistic regression on a moderate sample took 3 minutes to run

04.11.2025 16:41 β€” πŸ‘ 17    πŸ” 0    πŸ’¬ 8    πŸ“Œ 0

Hopefully this causes a paradigm shift and stops these papers from getting through.

Next we need clones of this paper for every social science discipline.

27.10.2025 18:43 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

This is excellent, and I'm so glad this paper was finally written, and so clearly as well. I basically write an equivalent every time I am consulting with someone proposing this type of study, and I'm so glad I can save my effort and just send them this instead!

27.10.2025 18:43 β€” πŸ‘ 12    πŸ” 1    πŸ’¬ 2    πŸ“Œ 0
A "methods primer" article in the journal "BMJ Medicine", titled "Factors associated with: problems of using exploratory multivariable regression to identify causal risk factors"

A "methods primer" article in the journal "BMJ Medicine", titled "Factors associated with: problems of using exploratory multivariable regression to identify causal risk factors"

We wrote an article explaining why you shouldn't put several variables into a regression model and report which are statistically significant - even as exploratory research. bmjmedicine.bmj.com/content/4/1/.... How did we do?

27.10.2025 17:39 β€” πŸ‘ 272    πŸ” 109    πŸ’¬ 26    πŸ“Œ 20

This sounds suspiciously like you want to interpret the coefficients from this model… Fit the best model for the data (probably logistic) and use marginaleffects to compute the quantity of interest.

24.10.2025 13:04 β€” πŸ‘ 4    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Only true for the ATT, but also equivalent to the just identified CBPS!

18.10.2025 11:17 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Looks like observations are being dropped due to missingness. Did you encode the censoring event as NA if it didn’t occur? I think it’s supposed to be encoded as logical. Would be helpful to see the function call, not just the output.

14.10.2025 10:58 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

πŸ™ƒ

13.10.2025 17:39 β€” πŸ‘ 5    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
Confidence Regions for Multiple Outcomes, Effect Modifiers, and Other Multiple Comparisons In epidemiology, some have argued that multiple comparison corrections are not necessary as there is rarely interest in the universal null hypothesis. From a parameter estimation perspective, epidemio...

For years I had trouble following some of the discussion about confidence bands, but at ACIC this year @noahgreifer.bsky.social pointed me to a helpful paper

So you don't have to be as perplexed as I once was, we have a new pre-print introducing the key ideas
arxiv.org/abs/2510.07076

09.10.2025 15:34 β€” πŸ‘ 19    πŸ” 7    πŸ’¬ 1    πŸ“Œ 0

My hot take is that "fixed effects" has a single, clear meaning that is equivalent across all subdisciplines of statistics.

05.10.2025 00:44 β€” πŸ‘ 9    πŸ” 0    πŸ’¬ 2    πŸ“Œ 0

bsky.app/profile/noah...

26.09.2025 15:58 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

These methods are new and bespoke, but I'd love to hear about if they inspire or help you in your own research! Feel free to let me know if you have any questions about the methodology. How would you have solved these problems?

18.09.2025 15:23 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Computation of the Balance-Sample Size Frontier in Matching Methods for Causal Inference Returns the subset of the data with the minimum imbalance for every possible subset size (N - 1, N - 2, ...), down to the data set with the minimum possible imbalance. Also includes tool...

All this can be done using my {MatchingFrontier} #Rstats package, which isn't yet on CRAN. This is part of my growing body of "cool new methods I've programmed but am too lazy to write a paper about". Please get in touch if you want to collab on some.

18.09.2025 15:23 β€” πŸ‘ 10    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

We used g-computation with a cluster-robust SE for pair membership. Because we dropped units from both groups, this analysis targeted the ATO, which is the best we could do given the lack of overlap.

I won't speak about the results (IMO they are less cool than the methods πŸ˜‰)

18.09.2025 15:23 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

After selecting our subset, we did a 2:1 pair match on the scaled Euclidean distance to assign each control unit a treated unit, which supplied its initiation date. Finally, we regressed the 90-day outcomes on the treatment and selected covariates in the matched sample and estimated the effect.

18.09.2025 15:23 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

The lowest energy distance was achieved with too small a sample to make inferences, given our hypothesized effect sizes. Instead, we chose the largest sample along the 2:1 energy distance frontier that had all SMDs below .1, and adjusted for remaining imbalance with regression.

18.09.2025 15:23 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

At each step, we dropped the unit that, when dropped, yielded the largest decrease in the energy distance, subject to the constraint that the ratio of control units to treated units was 2:1 so we could perform 2:1 matching in the final selected subset. This process is greedy, not optimal, but worked

18.09.2025 15:23 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

We dropped units to minimize the energy distance between the groups. The energy distance was described for balancing by Huling & Mak (2014); it is a scalar, multivariate measure of the difference between two *joint* distributions. In this case, those are the confounder distributions in the groups.

18.09.2025 15:23 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

We dropped units from the sample one at a time so that the units that remained formed a balanced sample. How did we decide which unit to drop at each step and when to stop dropping units? The framework for this is described by King et al (2017) as the "matching frontier".

18.09.2025 15:23 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

In traditional matching, pairing is used to identify a matched subset of the original sample that is balanced. Though we want pairs and and we want balance, it turns out we can do the subset selection first and the pairing second and get better results. Cho et al (2013) describe subset selection.

18.09.2025 15:23 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

References for the above, since these papers are not well known, but should be:

King et al (2017): doi.org/10.1111/ajps...
Huling & Mak (2024): doi.org/10.1515/jci-...
Cho et al (2013): doi.org/10.1111/stan...

18.09.2025 15:23 β€” πŸ‘ 4    πŸ” 1    πŸ’¬ 1    πŸ“Œ 0

To solve this, we combined several existing methods to develop our own. This was a combination of the matching frontier developed by King et al (2017), energy balancing developed by Huling & Mak (2024), and subset selection by Cho et al (2013).

18.09.2025 15:23 β€” πŸ‘ 3    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

Traditional and even advanced matching methods failed. PS matching, Mahalanobis distance matching, and cardinality matching all failed to achieve adequate balance or maintain sufficient sample size, even after trying many variations (calipers, etc.). We needed a more specialized approach.

18.09.2025 15:23 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

@noahgreifer is following 19 prominent accounts