R/balanced-simsem.R
balance.miss.l.Rd
balance.miss.l
runs simulations using lavaan and simsem. It returns the search results for optimal balanced item-level PM designs.
balance.miss.l(popModel, analyzeModel, NAMES, Time, Time.complete, k, pc, pd, costmx, n, nreps, focal.param, complete.var = NULL, eval.budget = T, rm.budget = NULL, distal.var = NULL, seed = 1234)
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. |
NAMES | 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. The parameters of focal interest.
The focal parameters should be specified in the format of
|
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. |
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 |
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. |
An object containing the information of the optimal balanced item-level missing design. The optimal design is the one that yields highest power for testing the focal parameters, compared to other plausible candidate PM designs.
simPM
which is a warpper function for this
function.