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

Description Usage Arguments Details Value Note Author(s) References Examples

View source: R/AllBackwardSelect.R

Description

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

Usage

1
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

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.

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.

Note

This is one of the most important functions for the user in this package. Also make sure the folder where the .inp and .out files are saved does not exist yet or exists but is empty. Also if re-running with same folder, delete previous results before re-running. if the m plus first .inp file fails to run due to a singularity issue, consider creating a new InputInitializeMat for Initialize. See CreateInitializeMatrix for the format of the InputInitializeMat, and consider replacing some 1 values for included paths with 0s to not include the path.

Author(s)

William Terry

References

M Plus and MplusAutomation

Examples

1
2
3
4
5
6
7
## Not run: 

InitD=Simulate(n=1000,MissingYN=1)
xxx=Initialize(InitD,NumImpute=3,WhichCat=c(1,1,1,1,0))
ggg=AllBackwardSelect(xxx[[1]])

## End(Not run)

PathSelectMP documentation built on May 2, 2019, 3:15 a.m.