Learn R Programming

PathSelectMP (version 1.1)

AllBackwardSelect: Run Backward Variable Selection in Path Analysis with M Plus

Description

performs backward selection in M Plus for all input data sets which is either 1 data set or more if imputations specified

Usage

AllBackwardSelect(AllNames, Directry = getwd(), PSig = 0.05)

Arguments

AllNames

string name of folder containing .inp and .out M Plus files, and also start of filenames for .inp and .out files

Directry

the path containing the folder where the M Plus files are saved and run default is current working directory

PSig

the alpha value to use for accepting or rejecting null hypothesis that coefficient is equal to zero in path

Value

There is no output from this function rather M Plus .inp and .out files are written and saved in the specified folder and path one at a time as backward stepwise variable selection is performed and updated.

Details

Backward variable selection is performed for an entire path where 1 variable at a time is deleted where the variable which is deleted has the highest p value for a total effect which is greater than PSig, and if no such variable in a path with corresponding p-value exists then the variable in a path with the highest p value for an indirect effect which is greater than PSig is deleted, and finally if no such variable in a path with corresponding p-value exists for the first two cases, then the variable in a path with the highest p value for a direct effect which is greater than PSig is deleted. This process repeats until no p-values for effects are greater than PSig.

References

M Plus and MplusAutomation

Examples

Run this code
# NOT RUN {
InitD=Simulate(n=1000,MissingYN=1)
xxx=Initialize(InitD,NumImpute=3,WhichCat=c(1,1,1,1,0))
ggg=AllBackwardSelect(xxx[[1]])
# }

Run the code above in your browser using DataLab