View source: R/get_ys_and_draws.R
get_draws_norm | R Documentation |
Used internally. This function generates draws from posterior, normal
distributions for continuous outcomes. Technically, these posteriors use no
priors (for simulation speed), corresponding to the use of improper flat
priors. These posteriors correspond (and give similar results) to using
normal-normal models (normally distributed outcome, conjugate normal prior)
for each arm, assuming that a non-informative, flat prior is used. Thus, the
posteriors directly correspond to normal distributions with each groups' mean
as the mean and each groups' standard error as the standard deviation.
As it is necessary to always return valid draws, in cases where < 2
patients have been randomised to an arm
, posterior draws will come from an
extremely wide normal distribution with mean corresponding to the mean of all
included patients with outcome data and a standard deviation corresponding to
the difference between the highest and lowest recorded outcomes for all
patients with available outcome data multiplied by 1000
.
get_draws_norm(arms, allocs, ys, control, n_draws)
arms |
character vector, currently active |
allocs |
character vector, allocations of all patients (including
allocations to currently inactive |
ys |
numeric vector, outcomes of all patients in the same order
as |
control |
unused argument in the built-in functions for
|
n_draws |
single integer, number of posterior draws. |
A matrix
(with numeric values) with length(arms)
columns and
n_draws
rows, with arms
as column names.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.