simPM: Search for an optimal PM design.

Description Usage Arguments Value

View source: R/wrapper-function.R

Description

simPM runs Monte Carlo simulations and returns the search results for optimal PM designs. This is a wrapper function for all the available searching methods.

Usage

1
2
3
4
5
simPM(popModel, analyzeModel, design0.out = NULL, VarNAMES, Time,
  Time.complete, k, pc, pd, costmx, n, nreps, focal.param,
  complete.wave = NULL, complete.var = NULL, max.mk = NULL,
  eval.budget = T, rm.budget = NULL, distal.var = NULL,
  seed = 1234, engine = "l", methods = "wave")

Arguments

popModel

The data generation model (population model) specified using lavaan script.

analyzeModel

The analysis model, specified using lavaan script. The analysis model can be different from the population model.

design0.out

An object returned by readModels. To obtain this object, the user need to have a Mplus output file which contains the a priori power analysis results for this specific model assuming a complete data design (i.e., simulation-based power analysis for sample size planning). In principle, a priori power analysis is supposed to be conducted before the study began.

VarNAMES

A character vector containing the names of the observed variables. The variable names must be ordered chronologically, by the time (wave) they are measured.

Time

Numeric. The total number of time points (or total number of waves of data collection).

Time.complete

Numeric. Number of waves of data collection that have been completed before the funding cut occurs.

k

Numeric. The number of observed variables collected at each wave.

pc

Numeric. Proportion of completers: the proportion of subjects that will participate in all of the following waves of data collection and provide complete data. This must be greater than 0.

pd

Numeric. The proportion of subjects that will not participate in any of the following waves of data collection (i.e., people who will drop from the longitudinal study). This value can be 0.

costmx

A numeric vector containing the unit cost of each observed variable that is yet to be measured (post the funding cut). The cost is assumed to be constant across subjects, but it is allowed to vary across variables and across waves.

n

The total sample size as initially planned.

nreps

Number of replications for Monte Carlo simulations.

focal.param

Character Vector. Specify the parameters of focal interest. If engine="l", the focal parameters should be specified following the format of lavaan script. If engine="m", the focal parameters should be specified in the specific format based on the Mplus output object design0.out.

complete.wave

Numeric vector. Specify which wave(s) that the user wish to have complete data collected from all the participants. Only applicable for wave-level PM designs.

complete.var

Char vector. Specify the name(s) of the variable(s) if there are any variable(s) that need to have complete data collected from all the participating subjects.

max.mk

Specify the maximum number of unique missing data patterns in the selected design. Only applicable if forward assembly is used.

eval.budget

Logical scalar (TRUE or FALSE), indicating whether there is any budget constraint. If the user wishes to search for PM designs under the budget limit, they need to specify the amount of the remaining available budget that can be used for future data collection.

rm.budget

Numeric. The amount of remaining budget avaialbe for future data collection. User must supply a value for this argument if eval.budget = TRUE.

distal.var

Char vector. Specify the name(s) of the distal variables. User needs to specify this argument if there are any time-independent distal variables included in the model that are not subject to planned missingness.

seed

The random seed for random number generation.

engine

Specify the whether the simulations should be conducted using lavaan/simsem (engine="l") or Mplus (engine="m").

methods

Specify which searching strategy should be used (wave-level PM designs only: methods = "wave"; balanced item-level PM designs only: methods = "indicator"; item-level PM designs via forward assembly: methods = "forward").

Value

An object containing the information of the optimal PM design. The optimal design is the one that yields highest statistical power for testing the focal parameters, compared to other plausible candidate PM designs.


YiFengEDMS/simPM documentation built on July 25, 2020, 4:08 a.m.