write data files and initial .inp files to setup file directory system for running backwards selection using M Plus
Initialize(InitialData, NumImpute = 0, DataFileName = "NewData",
NameFile = "New", Directry = getwd(),
NADes = c(-99), startSeedImputations = 1000,
InputInitializeMat = "N", WhichCat = rep(1, ncol(InitialData)),
AllMethods = c("logreg", "polr", "pmm"), WhichImpute = rep(1, ncol(InitialData)),
WhichRowsImp = c(1:nrow(InitialData)), PasteIND = 1)
dataframe of initial data
the number of imputated datasets to create default is 0 for no imputation
the name of the .dat file to be created from the initial data or imputed datasets default is "NewData"
the name of the folder where the .inp and .out files with the same base name are stored default is "New"
the path where the folder containing the .inp .out and .dat files are saved during backward selection
a list of length 1 with the value for missing data default is c(-99)
the seed for the first imputed data sets all other data sets seed is plus one from this value default is 1000
square dataframe where row name and column names are equal and are the variable names of InitialData with 1 for include path and 0 for exclude created by CreateInitializeMatrix
default creates upper triangular data frame
list of length number of variables in InitialData with 1 for categorical and 0 for continuous variables default is all 1s for all categorical data
default is set at "logreg" for binary imputation "polr" for categorical imputation "pmm" for continuous
list of length of names of InitialData specifying '1' for Impute column and '0' for no Imputation
list of length of number of rows of InitialData specifying '1' for Impute row and '0' for no Imputation
a value of 1 indicates to use all possible indirect effects in modelling and a value of 0 is input to only use direct effects in modelling
Output is list of length 2:
list containing the names of the folders containing each imputed data set path analysis
list containing the name of the imputed datasets which is just length one element if there are no imputations. Also files are written and saved.
this function must be run before using any other of the important functions in order to create initial input files
MplusAutomation
and mice
# NOT RUN {
InitD=Simulate(MissingYN=1)
xxx=Initialize(InitD,NumImpute=3,WhichCat=c(1,1,1,1,0))
# }
Run the code above in your browser using DataLab