Create Possible Path Matrix

Description

creates a dataframe with 1's and 0s' where a 1 represents inclusion in the path and 0 represents exlusion

Usage

1
CreateInitializeMatrix(InitialData, WhichCat, empty = FALSE)

Arguments

InitialData

the dataframe with the initial data

WhichCat

a vector of 0's and 1's length of number of columns of InitialData where 1 is a categorical variable and 0 is a continuous variable

empty

if empty is TRUE then a dataframe of all 0's is returned to allow user to individually assign 1's for path inclusion more easily

Details

the rows represent dependent variables in the path and the columns represent independent variables in the paths with a 1 representing in M Plus terminology row variable ON column variable

Value

returns matrix required by Initialize for all initial paths to run the default is an upper triangular matrix. This is a square matrix and names of rows is the same as the names of columns

Note

In this version only Categorical variables can be dependent variables and if using the default upper triangular matrix, due to the current way indirect effects are created, only approximately 8 or 9 variables can be used with reasonable computing time. The input to Initialize must be in the same format as this output so user may want to use this function with empty as FALSE and subtitute 1's for desired possible paths. Also note that row names and column names must be the same and must start with a capital letter and only contains numbers and letters in this version.

Author(s)

William Terry

References

M Plus

Examples

1
2
InitD=Simulate()
I=CreateInitializeMatrix(InitD,WhichCat=c(rep(1,ncol(InitD)-1),0))

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.