Description Usage Arguments Details Value See Also
View source: R/functions_outcome_simulation.R
These functions construct lists containing the structure and data for simulating exposure and outcome data.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | create_outcome_simulation_skeleton(design = "parallel", ...)
create_outcome_simulation_skeleton_parallel(
nstudies = 1,
nclusters = 1,
nunits = 1,
nobs = 1,
study_of_cluster,
cluster_of_unit,
unit_of_obs,
beta0 = 0,
x = 0,
nT = NA,
time = NA,
verbose = TRUE,
xfn = function(x) { x },
timefn = function(t) { rep(0, length(t)) }
)
|
design |
String indicating trial design. Currently only 'parallel' is supported. |
... |
Additional arguments passed to the design-specific functions. |
nstudies |
Number of studies. |
nclusters |
Number of clusters per study. If not of length |
nunits |
Number of units. |
nobs |
Number of observations per unit. If length 1, value is repeated for all units. If length |
study_of_cluster |
optional vector of positive integers that provide the study number of each cluster. Should have length |
cluster_of_unit |
optional vector that provides the cluster number of each unit. Should have length |
unit_of_obs |
optional vector that provides the unit number of each observation. Should have length |
beta0 |
Study-level intercept, on the logit scale. Defaults to 0 and can be updated later via |
x |
Exposure concentration values. Defaults to 0 and can be updated later via |
nT |
optional time-at-risk value. See |
time |
optional times for observations. Can be set later via |
verbose |
should messages be printed. |
xfn |
Exposure-response function. Can be set later via |
timefn |
Function relating time to mean outcome. Can be set later via |
These functions create the blank structure of groups, clusters, households, and unit.
Once parameters are set via expsim_update_parameter
and related functions, then data can be sampled via
expsim_sample_observations
and posterior parameter estimates obtained from sample_exposure_model
.
For creating a standata_outcome
object from an existing 'wide' format data frame, see create_standata_outcome
.
A list containing two sublists: structure
, which contains settings and parameters for generating data, and standata
which contains the study data in a format for sampling via STAN.
sample_outcome_model
, create_exposure_simulation_skeleton
Other outcome simulation functions:
outsim_sample_observations()
,
outsim_update_parameter()
,
sim_update_times()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.