simulate | R Documentation |
simulate(nobs, nexper, nhyp, config)
nobs |
Number of observations (may be a vector) |
nexper |
Number of experiments for each |
nhyp |
Total number of hypotheses (nulls and alternatives) in each experiment. |
config |
A data frame, consists information about the different cases (values of true parameters) in the following columns:
|
A tibble with length(nobs) * nexper * nhyp
rows. Each row
corresponds to an realization of an estimator, assumed to be an
approximation to an asymptotically normal estimator with root-n rate
(based on n observations). The simulations here are based on the
normal approximations, and consists of the following columns:
nobs
: Number of observations (affecting the standard
deviation). Values are from the given value in the corresponding
parameter nobs
.
exper
: Serial number of the experiment in the current
nobs
value.
case
: Identifier of the true case of the hypothesis. In each
experiment the hypotheses are distributed according to config
.
g
and b
: The true parameters. Their values depends
on the parameters in the config, and on the current nobs
value:
γ_n = gaddend + gfactor * nobs^gexp
; β_n =
baddend + bfactor * nobs^bexp
.
gestim
and bestim
: estimators for γ_n and
β_n, distributed independently from Normal distribution with
mean γ_n and β_n respectively, and with standard
deviation equals 1/√ n.
gpval
and bpval
: Corresponding p-values,
under the null hypotheses γ = 0 and β = 0,
respectively.
Simulate data for mediation hypotheses
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.