Interval vectors (ivs) in R

“ivs (said, “eye-vees”) is a package dedicated to working with intervals in a generic way. It introduces a new type, the interval vector, which is generally referred to as an iv. An iv is generally created from two parallel vectors representing the starts and ends of the intervals…”

Over here

Examples:

> iv_set_union(iv(2, pi), iv(3, 5))
[1] [2, 5)

> iv_set_union(iv(2, pi), iv(4, 5))
[1] [2, 3.141593) [4, 5.000000)

> iv_set_intersect(iv(0, pi), iv(3, 1000))
[1] [3, 3.141593)

> iv_set_union(iv(0, pi), iv(3, 1000))
[1] [0, 1000)

> iv_between(exp(1), c(iv(0, pi)))
[1] TRUE

> iv_between(pi, c(iv(0, pi)))
[1] FALSE

Trying elastic net regularisation with correlated predictors

First simulate data where \(x_1\) to \(x_3\) are identical and \(x_4\) is uncorrelated with them. Each \(x\) is a z-score.

Set \(y = 0.2 (x_1 + x_2 + x_3) + 0.3 x_4 + \epsilon\).

Now try elastic nets, varying \(\alpha\) from 0 (ridge regression) to 1 (lasso). I used 10‑fold cross‑validation to select \(\lambda\), keeping the coefficients for the smallest \(\lambda\), and used the same fold assignments across all values of \(\alpha\).

Here’s a picture of the coefficients. Note how the correlated predictor slopes separate as \(\alpha\) increases until only one survives with a slope of about three times 0.2 (to compensate for the other missing identical predictors). The uncorrelated predictor slope stays the same.

Here’s a table of coefficients for a selection of \(\alpha\), including the results from an unpenalised regression with only \(x_1\) and \(x_4\) as predictors:

Variableα = 0α = 0.9α = 1Unpenalised
regression
(Intercept)0.0020.0020.0020.002
x10.1980.2430.6000.603
x20.1960.188
x30.1950.169
x40.2710.2870.2870.290

Extended two-way fixed effects

selectTWFE looks interesting: “Estimates both a vanilla two-way fixed effects (TWFE) model and an extended TWFE (ETWFE) model, then selects between them using Cochran’s Q test for heterogeneity. When ETWFE wins, reports the heterogeneity fraction (I-squared) and cohort-time estimates with empirical Bayes shrinkage and Bonferroni multiplicity correction.”

Resignations

Interesting dataset from the Institute for Government. (I last updated this after Streeting resigned.)

Here’s a cumulative count of resignations that were coded by IfG as being due to “disagreement”, for a selection of PMs. The dashed horizontal line shows Starmer’s count:

Expanding out to all PMs in the data (from Thatcher to Sunak), how long did they have left as the number of resignations grew? (Note: different colours – also remember the small number of PMs!)

Another attempt to visualise (again, remember small n – the lines give a range not uncertainty!). Purple marks where Starmer is currently at, though the data excludes him since he’s still PM.

Counterfactual without a comparison group

“Following the approval of Bill 56, Building a More Competitive Economy Act, 2025, all automated speed enforcement cameras were deactivated on November 13, 2025. The city has since been collecting and analyzing speed data at the original eight pilot locations to evaluate the impact of the camera removals. Monthly updates are provided for each site, including average speed, 85th percentile speed, speed-limit compliance rates, and the proportion of high-end speeders. This data is presented alongside baseline conditions prior to ASE camera installation and results observed during the enforcement period.”

Data here (hat tip @sjamieit.bsky.social). Here’s a pic, drawn using ggplot in R.

ggauto

“ggauto is designed to choose the best chart type, based on the type of data that you have. That means that you need to pre-process your data into the correct type before plotting it. This is a requirement to make ggauto possible, but is more generally a good idea because it forces you to understand what your data is before you plot it.”

Looks cool. Blog post here.

Install from CRAN: install.packages(“ggauto”)

The bargraphs of evaluation approaches

Scroll down for a redrawing of Schröter, Becho, and Montrosse-Moorhead’s (2026) characterisation of broad evaluation approaches. R code here.

Their assessments of each approach on 8 dimensions are linked here:

References

Schröter, D., Becho, L. W., & Montrosse-Moorhead, B. (2026). The garden of evaluation approaches: Supporting explicit, theory-informed evaluation practice. Evaluation.