<- 50
N <-
design declare_model(N = N, b = runif(1, min = 0, max = 1), u = runif(N, min = 0, max = 1),
potential_outcomes(Y ~ (u < b)*Z + (u > (1 + b)/2))) +
declare_assignment(Z = complete_ra(N)) +
declare_inquiry(ATE = b[1]) +
declare_measurement(Y = reveal_outcomes(Y ~ Z)) +
declare_estimator(Y ~ Z)
The humble
This post is inspired by conversations with @david_colquhoun who has been doing a lot of work on the misinterpretation of p-values (see especially “The false positive risk: a proposal concerning what to do about p values”). David poses the question “what is the probability that the null hypothesis is true given the observed
The key insight is that there is something to the intuition that if the world doesn’t look how it ought to look if indeed some hypothesis is right, then maybe that hypothesis isn’t right. Formally the connection comes via Bayes rule; the
But what if you did have access to priors? With priors, you can construct Bayesian inferences from the diagnosis of a frequentist design. If we encode our priors into the population declaration then we can map from
Here is an illustration. Unlike most other designs we have looked at, in this design the estimand has a distribution. For simplicity we consider a design with a binary outcome; the estimand is the average treatment effect (or in epidemiology the “absolute risk increase”). The distribution for b
in our model of the world reflects our beliefs about the estimand: we assume that it is distributed uniform over 0 and 1.3
When we simulate this design, each run takes a different estimand (b
) from the uniform distribution, generates data and calculates effects and
<- simulate_design(design) simulations
Now if we graph the estimand from each run against the
%>%
simulations ggplot(aes(y = estimand, x = p.value)) +
geom_point(size = 1, alpha = 0.1) +
stat_smooth(se = FALSE) +
scale_x_continuous(trans='sqrt', breaks = c(0.001, 0.01, 0.05, 0.1, 0.25, 0.5, 1)) +
xlab("p.value (square root scale to clearly distinguish small values)")
We see from the graph that a Bayesian who has access to the study design and who learns only about the
Posterior beliefs about a null require prior mass on the null
We have shown a set of posterior distributions and marked the posterior mean, but we have not calculated the probability that the null is true. The reason is that, if the prior places a zero probability on the null hypothesis ate
is small”) rather than a value (“the ate
is 0”). Another possibility is that you really put prior probability mass on a point null, which is what we do here.
Here we make a new design, in which we specify the prior belief that the true effect is 0 with 50% probability, and otherwise is flat over [0,1]. Remember, our priors are coded in the distribution we provide for b
in our model of the world. Here’s the modified design:
<- declare_model(N = N,
pop_mass b = sample(c(0, runif(1, min = 0, max = 1)), prob = c(.5, .5), size = 1),
u = runif(N, min = 0, max = 1))
<- replace_step(design, 1, pop_mass) design_mass
We simulate the design again, but this time on the
<- simulate_design(design_mass) simulations
The
Warning: Posteriors depend on the design, not just on the results
It is nice that one can make inferences about estimands using
We illustrate briefly by expanding design_mass
to two designs with different
<- redesign(design_mass, N = c(50, 500)) designs
We see here that for any
Implications for frequentist friends
Design diagnosis does not substitute for proper Bayesian analysis. However, there is a payoff for Bayesians with frequentist friends. If you can get them to encode their prior beliefs and declare their designs, then you get a tool to quickly figure out what they should believe given what they find.
Footnotes
David’s goal is more ambitious also as he is advocating for a new reporting norm for conveying the strength of evidence and so he explicitly seeks a statistic that is easy to calculate and can be calculated with a kind of common prior.↩︎
If
is the probability of the data under the null, and is the quantity we care about (the probability of the null given the data), is the prior on the null, and and are corresponding quantities for a complementary hypothesis, then Bayes rule says .↩︎More precisely we assume a process in which for effect
, share of the units are affected positively by treatment, share has outcome regardless and share has outcome regardless. Note that this is an informative prior—in particular it rules out the possibility of negative effects.↩︎It’s easy and interesting to do the same thing to assess what one should believe about the estimand given the estimate (or given both the estimate and the
-value.)↩︎