Skip to content
Archive of posts filed under the Multilevel Modeling category.

Election 2020 is coming: Our poll aggregation model with Elliott Morris of the Economist

Here it is. The model is vaguely based on our past work on Bayesian combination of state polls and election forecasts but with some new twists. And, check it out: you can download our R and Stan source code and the data! Merlin Heidemanns wrote much of the code, which in turn is based on […]

Faster than ever before: Hamiltonian Monte Carlo using an adjoint-differentiated Laplace approximation

Charles Margossian, Aki Vehtari, Daniel Simpson, Raj Agrawal write: Gaussian latent variable models are a key class of Bayesian hierarchical models with applications in many fields. Performing Bayesian inference on such models can be challenging as Markov chain Monte Carlo algorithms struggle with the geometry of the resulting posterior distribution and can be prohibitively slow. […]

In Bayesian priors, why do we use soft rather than hard constraints?

Luiz Max Carvalho has a question about the prior distributions for hyperparameters in our paper, Bayesian analysis of tests with unknown specificity and sensitivity: My reply: 1. We recommend soft rather than hard constraints when we have soft rather than hard knowledge. In this case, we don’t absolutely know that spec and sens are greater […]

New report on coronavirus trends: “the epidemic is not under control in much of the US . . . factors modulating transmission such as rapid testing, contact tracing and behavioural precautions are crucial to offset the rise of transmission associated with loosening of social distancing . . .”

Juliette Unwin et al. write: We model the epidemics in the US at the state-level, using publicly available death data within a Bayesian hierarchical semi-mechanistic framework. For each state, we estimate the time-varying reproduction number (the average number of secondary infections caused by an infected person), the number of individuals that have been infected and […]

This one’s important: Designing clinical trials for coronavirus treatments and vaccines

I’ve had various thoughts regarding clinical trials for coronavirus treatments and vaccines, and then I came across thoughtful posts by Thomas Lumley and Joseph Delaney on vaccines. So let’s talk, first about treatments, then about vaccines. Clinical trials for treatments The first thing I want to say is that designing clinical trials is not just […]

Simple Bayesian analysis inference of coronavirus infection rate from the Stanford study in Santa Clara county

tl;dr: Their 95% interval for the infection rate, given the data available, is [0.7%, 1.8%]. My Bayesian interval is [0.3%, 2.4%]. Most of what makes my interval wider is the possibility that the specificity and sensitivity of the tests can vary across labs. To get a narrower interval, you’d need additional assumptions regarding the specificity […]

Updated Imperial College coronavirus model, including estimated effects on transmissibility of lockdown, social distancing, etc.

Seth Flaxman et al. have an updated version of their model of coronavirus progression. Flaxman writes: Countries with successful control strategies (for example, Greece) never got above small numbers thanks to early, drastic action. Or put another way: if we did China and showed % of population infected (or death rate), we’d erroneously conclude that […]

New analysis of excess coronavirus mortality; also a question about poststratification

Uros Seljak writes: You may be interested in our Gaussian Process counterfactual analysis of Italy mortality data that we just posted. Our results are in a strong disagreement with the Stanford seropositive paper that appeared on Friday. Their work was all over the news, but is completely misleading and needs to be countered: they claim […]

MRP with R and Stan; MRP with Python and Tensorflow

Lauren and Jonah wrote this case study which shows how to do Mister P in R using Stan. It’s a great case study: it’s not just the code for setting up and fitting the multilevel model, it also discusses the poststratification data, graphical exploration of the inferences, and alternative implementations of the model. Adam Haber […]

Conference on Mister P online tomorrow and Saturday, 3-4 Apr 2020

We have a conference on multilevel regression and poststratification (MRP) this Friday and Saturday, organized by Lauren Kennedy, Yajuan Si, and me. The conference was originally scheduled to be at Columbia but now it is online. Here is the information. If you want to join the conference, you must register for it ahead of time; […]

Fit nonlinear regressions in R using stan_nlmer

This comment from Ben reminded me that lots of people are running nonlinear regressions using least squares and other unstable methods of point estimation. You can do better, people! Try stan_nlmer, which fits nonlinear models and also allows parameters to vary by groups. I think people have the sense that maximum likelihood or least squares […]

“For the cost of running 96 wells you can test 960 people and accurate assess the prevalence in the population to within about 1%. Do this at 100 locations around the country and you’d have a spatial map of the extent of this epidemic today. . . and have this data by Monday.”

Daniel Lakeland writes: COVID-19 is tested for using real-time reverse-transcriptase PCR (rt-rt-PCR). This is basically just a fancy way of saying they are detecting the presence of the RNA by converting it to DNA and amplifying it. It has already been shown by people in Israel that you can combine material from at least 64 […]

“Are Relational Inferences from Crowdsourced and Opt-in Samples Generalizable? Comparing Criminal Justice Attitudes in the GSS and Five Online Samples”

Justin Pickett writes: You’ve blogged a good bit on MTurk, weighting, and model-based inference. Drawing heavily on your work (Gelman, 2007; Gelman and Carlin, 2002; Wang et al., 2015), Andrew Thompson and I [Pickett] just published a study that largely confirms your concerns about MTurk (and opt-in samples), but that also emphasizes the promise of […]

Computer-generated writing that looks real; real writing that looks computer-generated

You know that thing where you stare at a word for long enough, it starts to just look weird? The letters start to separate from each other, and you become hyper-aware of the arbitrariness of associating a concept with some specific combination of sounds? There’s gotta be a word for this. Anyway, I was reminded […]

MRP Conference registration now open!

Registration for our MRP mini conference/meeting is now open. Please go to the conference website to register.  Places are limited so make sure you register so you don’t miss out! Abstract submissions will be open until the end of this month. Other than the great talks that we already have submitted, I’m super excited because […]

MRP Conference at Columbia April 3rd – April 4th 2020

The Departments of Statistics and Political Science and Institute for Social and Economic Research and Policy at Columbia University are delighted to invite you to our Spring conference on Multilevel Regression and Poststratification. Featuring Andrew Gelman, Beth Tipton, Jon Zelner, Shira Mitchell, Qixuan Chen and Leontine Alkema, the conference will combine a mix of cutting […]

Advice for a Young Economist at Heart

Shoumitro Chatterjee, who sent me that paper we discussed yesterday, writes: I [Chatterjee] recently finished my PhD in economics from Princeton and am starting as junior faculty at Penn State. I do applied work on development using observational and administrative data, and I have a few questions: 1. Is there a difference between multiple comparisons […]

MRP Carmelo Anthony update . . . Trash-talking’s fine. But you gotta give details, or links, or something!

Before getting to the main post, let me just say that I’m a big fan of Nate Silver. Just for one example: I’m on record as saying that primary elections are hard to predict. So I don’t even try. But there’s lots of information out there: poll data, fundraising numbers, expert opinion, delegate selection rules, […]

Forget about multiple testing corrections. Actually, forget about hypothesis testing entirely.

Tai Huang writes: I am reading this paper [Why we (usually) don’t have to worry about multiple comparisons, by Jennifer, Masanao, and myself]. I am searching how to do multiple comparisons correctly under Bayesian inference for A/B/C testing. For the traditional t-test approach, Bonferroni correction is needed to correct alpha value. I am confused with […]

They added a hierarchical structure to their model and their parameter estimate changed a lot: How to think about this?

Jesús Humberto Gómez writes: I am an epidemiologist and currently I am studying my fourth year of statistics degree. Currently we have a dataset with data structure shown here: We want to investigate the effect of mining contamination on the blood lead levels. We have a total of 8 inhabited locations and the participants and […]