run_sim: Run a simulation

Description Usage Arguments Details Value

View source: R/sim.R

Description

Repeatedly fit the LC, LCRE and FM model onto a specific scenaria.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
run_sim(
  B = 4,
  n = 250,
  tau = 0.08,
  miss.prop = 0.2,
  data.gen = c("lc", "lcre", "fm"),
  lc.method = "MCMC",
  lcre.method = "MCMC",
  pb,
  object = NULL
)

Arguments

B

Number of replications

n

(numeric) Sample size

tau

(numeric, between 0 and 1) Prevalence

miss.prop

(numeric, between 0 and 1) Missing proportion

data.gen

The data generating mechanism

lc.method

(DEPRECATED) The latent class model estimation method

lcre.method

(DEPRECATED) The latent class model with random effects estimation method

pb

Not used

object

A diagaccSim1 object

Details

The framework for the simulation is as follows:

  1. Randomly generate a specific data set according to the data.gen mechanism and the settings as per n, tau, and miss.prop.

  2. Fit a LC, LCRE and FM model onto the data set.

  3. Repeat steps 1–2 a total of B number of times.

Note that it is possible to continue on a simulation run by calling the saved object in the argument. See the example section.

Value

A diagaccSim1 object. It is a list of length four containing the following items:


haziqj/diagacc documentation built on Nov. 21, 2020, 5:40 p.m.