Advertisement · 728 × 90

Posts by Fabio Martinenghi

Post image

Life satisfaction mostly declines with age. Previous findings (esp. the famous U-shaped age-SWB trajectory) were artifacts of misspecified models. doi.org/10.1093/esr/...

6 months ago 164 51 10 40

Like this! sessioninfo::session_info() can now (or will after review) output to LaTeX #rstats github.com/r-lib/sessio...

7 months ago 44 4 0 0
Post image

Extending ideas originally proposed by Charles Manski in 1988 and considering quantile-welfare evaluations of health policy as an alternative to utilitarian evaluation, from Charles F. Manski and @johnmullahy.bsky.social https://www.nber.org/papers/w34247

7 months ago 10 1 1 0
Preview
The Effects of a Place-Based Intervention on Resident Reporting of Crime and Service Needs: A Frontier Matching Approach Prior research has found that reporting of crime incidents and service needs remain low in many U.S. cities. This study employs a matching strategy using observational data from a large public repo...

A new paper I worked on is out in Justice Quarterly! I won't speak on the substantive nature of the paper as I worked solely as the methodologist, but I developed a new matching method not otherwise described in the literature, and I want to tell you about it!

#statssky #casualsky

7 months ago 26 5 2 1
Post image

For the open source devotees out there, I've integrated @OpenFreeMapOrg into the #rstats {mapgl} package.

Do `maplibre(style = openfreemap_style("liberty"))` for an excellent street map with 3D buildings; "bright" & "positron" are also available.

Map with no API keys required!

7 months ago 21 4 2 0
37  Performance – Model to Meaning

The new {marginaleffects} release for #RStats (0.30.0) comes with two new vignettes:

1. Speed up computation with automatic differentiation (often 10x gains) marginaleffects.com/bonus/perfor...

2. Power analyses with {marginaleffects} and {DeclareDesign}. marginaleffects.com/bonus/power....

7 months ago 145 34 3 3
Preview
ggplot2 4.0.0 A new major version of ggplot2 has been released on CRAN. Find out what is new here.

I am beyond excited to announce that ggplot2 4.0.0 has just landed on CRAN.

It's not every day we have a new major #ggplot2 release but it is a fitting 18 year birthday present for the package.

Get an overview of the release in this blog post and be on the lookout for more in-depth posts #rstats

7 months ago 849 280 9 50
Introduction to Working with Data: R Version

New The Effect materials today: introductions to basic coding and data manipulation in R, Stata, and Python. Get the wheels turning on using these languages with data with these intro pages and exercises:
nickchk.com/Coding%20and...
nickchk.com/Coding%20and...
nickchk.com/Coding%20and...

7 months ago 44 15 0 2

My paper on designing and analyzing powerful experiments is now up online at Fiscal Studies. Here is my shareable link for free access: onlinelibrary.wiley.com/share/author...

7 months ago 14 3 0 1
Advertisement
Preview
R Dev Day @ Australia 2025 Fri, Nov. 21st, 2025

📢 R Dev Day @ Australia

🏢 Monash University, Melbourne
🌐 Remote, Australia
📅 Fri 21 Nov

It's happening!

Apply to attend this free event, to collaborate on contributions to #RStats! You don't need to be an R guru!

Deadline Sunday 16 Nov: pretix.eu/r-contributo...

#RDevDay #RSEng

7 months ago 10 14 0 0

Running R code on your phone... that is definitely magic!!

webR also makes it super easy to create #rstats learning resources that students can work with using just a browser, no install drama needed.

jen-richmond.quarto.pub/barbarplots/

8 months ago 26 5 0 3

Didn't they get the memo that some of us use Windows for work, not to roleplay Tron?

8 months ago 0 0 0 0
Post image Post image Post image

Grad programs often don't teach folks how to write good reviewer reports. Here are some resources:

1. @brendannyhan.bsky.social review checklist: thepoliticalmethodologist.files.wordpress.com/2016/02/tpm_...

2. "How to Write an Effective Referee Report": aeaweb.org/articles?id=...

What else?

8 months ago 109 31 6 2
Post image

Source: "Producing Health: Measuring Value Added of Nursing Homes"

Forthcoming, Econometrica

dropbox.com/scl/fi/3nw2j...

8 months ago 4 1 1 0
Post image

All good things come in pairs. Or threes?
My 3rd paper using football data. This time a labor question.

draft! Comments welcome
papers.ssrn.com/sol3/papers....

8 months ago 26 4 1 0

Lol I love this hot take. On point.

8 months ago 1 0 0 0
Advertisement

Highly relevant to anybody working with regression discontinuity designs

8 months ago 10 3 0 0

Georgia Papadogeorgou, Zhaoyan Song, Guido Imbens, Fabrizia Mealli: Causal Inference when Intervention Units and Outcome Units Differ https://arxiv.org/abs/2507.20231 https://arxiv.org/pdf/2507.20231 https://arxiv.org/html/2507.20231

8 months ago 3 2 0 0

How insane is it that openai asks for BIOMETRIC information for using its API with the o3 model?! Asking me to take a selfie and upload personal documents. Anthropic, here I come #dataskyence

8 months ago 1 0 0 0

Yes please!

8 months ago 1 0 0 0

Something you might find helpful is ggview::canvas() for setting the in RStudio viewing pane to be in the proportions you intend to export in. So it should look the same as a saved figure.

8 months ago 27 2 4 1

A little while ago I saw a really beautiful colour palette/colour science post. It was something to do with capturing pastel/water colours and transformations to the colourspace. I can't for the life of me remember what is was called, does anyone remember this? #rstats

9 months ago 7 8 2 0

Revising my survey and experiments grad course and looking for examples of papers that do a good job of (really) integrating observational and experimental data. Suggestions? Self-reference welcome.

9 months ago 14 7 7 0

Very very interesting and looking forward to reading it in full

9 months ago 5 1 0 0
Chapter 6 Nonparametric regression | Notes for Predictive Modeling <p>Notes for Predictive Modeling. MSc in Big Data Analytics. Carlos III University of Madrid.</p>

These course notes on nonparametric regression (including kernel density estimation) by Eduardo García Portugués are *fantastic*. So clear, with great visuals and clear code.

9 months ago 54 5 4 0
Advertisement

This goes in the right direction but I guess I'm wondering what is the best practice for implement something like this in latex

9 months ago 1 0 0 0

I'm talking about several things at once. The mechanical way of placing figures is maybe easier to figure out. But how to do it in a way that is aesthetically pleasing, like a professional magazine editor would it, is less easy. It's an overlooked aspect of data viz

9 months ago 1 0 1 0

#rstats and TeX friends: what are your best takes on how to nicely size and place figures in academic articles? I spend time curating my #dataviz but then I default to big page-wide plots that end up automatically at the bottom of the document. Any tips/resources?
#latex

9 months ago 6 1 1 1
Screenshot of a connection to a DuckDB database, and a screenshot of the columns of one of the tables in that database

Screenshot of a connection to a DuckDB database, and a screenshot of the columns of one of the tables in that database

Table of contents for the post:

- DuckDB, {DBI}, and the difficulty of discerning data in a database
- DuckDB, {connections}, and the magical Connections Pane
- Bonus: Better support for DuckDB in the Connections Pane
- The whole game

Table of contents for the post: - DuckDB, {DBI}, and the difficulty of discerning data in a database - DuckDB, {connections}, and the magical Connections Pane - Bonus: Better support for DuckDB in the Connections Pane - The whole game

R code for connecting to a database, adding stuff to it, extracting it, and plotting it

library(tidyverse)

# Use nicer DuckDB Connections Pane features
options("duckdb.enable_rstudio_connection_pane" = TRUE)

# Connect to an in-memory database, just for illustration
con <- connections::connection_open(duckdb::duckdb(), ":memory:")

# Add stuff to it
copy_to(
  con,
  gapminder::gapminder,
  name = "gapminder",
  overwrite = TRUE,
  temporary = FALSE
)

# Get stuff out of it
gapminder_2007 <- tbl(con, I("gapminder")) |>
  filter(year == 2007) |>
  collect()

# All done
connections::connection_close(con)

# Make a pretty plot, just for fun
ggplot(gapminder_2007, aes(x = gdpPercap, y = lifeExp)) +
  geom_point(aes(color = continent)) +
  scale_x_log10(labels = scales::label_dollar(accuracy = 1)) +
  scale_color_brewer(palette = "Set1") +
  labs(
    x = "GDP per capita",
    y = "Life expectancy",
    color = NULL,
    title = "This data came from a DuckDB database!"
  ) +
  theme_minimal(base_family = "Roboto Condensed")

R code for connecting to a database, adding stuff to it, extracting it, and plotting it library(tidyverse) # Use nicer DuckDB Connections Pane features options("duckdb.enable_rstudio_connection_pane" = TRUE) # Connect to an in-memory database, just for illustration con <- connections::connection_open(duckdb::duckdb(), ":memory:") # Add stuff to it copy_to( con, gapminder::gapminder, name = "gapminder", overwrite = TRUE, temporary = FALSE ) # Get stuff out of it gapminder_2007 <- tbl(con, I("gapminder")) |> filter(year == 2007) |> collect() # All done connections::connection_close(con) # Make a pretty plot, just for fun ggplot(gapminder_2007, aes(x = gdpPercap, y = lifeExp)) + geom_point(aes(color = continent)) + scale_x_log10(labels = scales::label_dollar(accuracy = 1)) + scale_color_brewer(palette = "Set1") + labs( x = "GDP per capita", y = "Life expectancy", color = NULL, title = "This data came from a DuckDB database!" ) + theme_minimal(base_family = "Roboto Condensed")

Scatterplot showing global health and wealth from gapminder in 2007

Scatterplot showing global health and wealth from gapminder in 2007

Another @posit.co Positron blog post! To make it easier to work with some huge data in one of my projects, I've loaded it into @duckdb.org. The Connections Pane makes it really easy and convenient to connect to and explore databases with #rstats. Here's how: www.andrewheiss.com/blog/2025/07...

9 months ago 82 19 0 0