This function provides some basic checks on the strength of the prior in the MRLocus slope fitting Bayesian model. It is not desired that the prior overly influences the posterior inference.

priorCheck(res, n = 200, plot = TRUE, type = 1)

Arguments

res

output of fitSlope

n

integer, for the plot how many data points to simulate

plot

logical, whether to draw the plots

type

integer, return type. by default (type=1) the function returns a table. By setting type=2, the prior predictive draws for alpha, sigma, beta_a, and beta_b are returned. See Details regarding the simulated draws for beta_a

Value

a data.frame with information about prior and posterior SD for alpha and sigma, and two plots are generated (see Details)

Details

The posterior-over-prior SD ratio is calculated and returned in a table, and two plots are made that show parameters drawn from the estimated priors (in MRLocus, priors are estimated from the data). Alternatively, the prior predictive draws themselves can be returned instead of the table (by setting type=2).

If the posterior-over-prior SD ratio is close to 1 for either alpha or sigma, this indicates undesirable influence of the prior on the posterior inference. For comparison, some consider a posterior-prior SD ratio of 0.1 or higher to be described as an 'informative prior' (from Stan wiki on prior choice recommendations). We note that an 'informative prior' alone is not problematic for MRLocus, and the prior estimation steps have been designed to be informative as to reasonable values for the parameters alpha and sigma.

The plots show parameters generated from the prior and the model. The simulated true values of beta_a and beta_b are drawn as black circles (summary statistics would then be drawn from these according to the reported SEs, but this step of the model is omitted in this plot). The two plots differ in that the second plot fixed alpha instead of drawing it from the model (so that the prior for sigma can better be visualized). The fitted estimates of beta_a and beta_b from the colocalization step are shown as blue X's. One exception where parameters are not drawn from the prior is: beta_a values are instead drawn as uniform between 0 and 1.1x the maximum value of beta_hat_a from the colocalization step (for ease of visualization).