Description Usage Arguments Details See Also Examples
View source: R/functions_exposure_simulation.R
Sets or overwrites data-generating parameters for an exposure model object
1 2 3 4 5 6 7 8 |
obj |
'expsim' object to update |
param |
character string giving name of parameter to update. If not provided, parameter name is taken from |
level |
character string of model level being updated. Must be one of "group", "cluster", "unit", "observation", or "time". See Details. |
type |
character string giving type of parameter being updated. See Details. |
value |
value(s) to which parameter should be set |
draw |
if |
Only specific combinations of level
and type
are allowed. They are:
"group"
: "mean"
sets 'etaG'
"cluster"
: "sd"
and "re"
set 'sigK' and 'reK', respectively
"unit"
: "sd"
and "re"
set 'sigI' and 'reI', respectively
"observation"
: "sd"
sets 'sigW'.
"time"
: "mean"
sets 'timefn'.
Other exposure simulation functions:
create_exposure_simulation_skeleton()
,
expsim_sample_observations()
,
sim_update_times()
1 2 3 4 5 6 7 8 9 10 11 12 13 | # Create simulation structure
es <- create_exposure_simulation_skeleton_parallel(ngroups=2, nunits=10)
# No standard deviation parameter set by default
es$structure$sigK
# Add standard deviation parameter value
es <- expsim_update_parameter(es, level="cluster", type="sd", value=1)
es$structure$sigK
# Sample random effect values
es <- expsim_update_parameter(es, level="cluster", type="re", draw=TRUE)
# Add time function
es <- expsim_update_parameter(es, level="time", type="mean", value=function(w) 2*cos(w))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.