shrink_simulate: Simulate data for mediation estimation

View source: R/shrink_simulate.R

shrink_simulateR Documentation

Simulate data for mediation estimation

Usage

shrink_simulate(nobs, nrep, config)

Arguments

nobs

Number of observations (may be a vector)

nrep

Number of experiments for each nobs value.

config

A data frame, consists information about the different cases (values of true parameters) in the following columns: gfactor and bfactor; and gexp and bexp: numeric constants used to define the true parameters γ_n and β_n.

Value

A tibble with length(nobs) * nrep * nrows(config) 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.

  • case: Identifier of the true case of the hypothesis.

  • g and b: The true parameters. Their values depends on the parameters in the config, and on the current nobs value: γ_n = gfactor * nobs^gexp; β_n = 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.

Simulate data for mediation estimation


yotamleibovici/twostageshrink documentation built on Sept. 15, 2022, 7:30 p.m.