Learn an empirical distribution on estimation bias by simultaneously analyzing a large set of negative control outcomes by a Bayesian hierarchical model through MCMC. Analysis is based on a list of extracted likelihood profiles.
fitBiasDistribution(
likelihoodProfiles,
priorSds = c(2, 0.5),
numsamps = 10000,
thin = 10,
minNCs = 5,
robust = FALSE,
df = 4,
seed = 1
)
A list of grid profile likelihoods regarding negative controls.
A two-dimensional vector with the standard deviation of the prior for the average bias and the sd/scale parameter, respectively.
Total number of MCMC samples needed.
Thinning frequency: how many iterations before another sample is obtained?
Minimum number of negative controls needed to fit a bias distribution; default (also recommended): 5.
Whether or not to use a t-distribution model; default: FALSE.
Degrees of freedom for the t-model, only used if robust is TRUE.
Seed for the random number generator.
A dataframe with three columns and numsamps
number of rows.
Column mean
includes MCMC samples for the average bias,
scale
for the sd/scale parameter,
and bias
for predictive samples of the bias.
# load example data
data("ncLikelihoods")
# fit a bias distributions by analyzing a set of negative control outcomes
# for example, for the 5th analysis period, and using the t model
# NOT RUN
# biasDistribution = fitBiasDistribution(ncLikelihoods[[5]], robust = TRUE)