gimmeSEM: Group iterative multiple model estimation.

Description Usage Arguments Details Author(s) References Examples

Description

This function identifies structural equation models for each individual that consist of both group-level and individual-level paths.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
gimmeSEM(data        = "",
         out         = "",
         sep         = "",
         header      = ,
         ar          = TRUE,
         plot        = TRUE,
         subgroup    = FALSE,
         confirm_subgroup = NULL,
         paths       = NULL,
         exogenous   = NULL,
         groupcutoff = .75,
         subcutoff   = .5,
         diagnos     = FALSE)

Arguments

data

The path to the directory where the data files are located, or the name of the list containing each individual's time series. Each file or matrix must contain one matrix for each individual containing a T (time) by p (number of variables) matrix where the columns represent variables and the rows represent time. Individuals must have the same variables (p) but can have different lengths of observations (T).

out

The path to the directory where the results will be stored (optional). If specified, a copy of output files will be replaced in directory. If directory at specified path does not exist, it will be created.

sep

The spacing of the data files. "" indicates space-delimited, "/t" indicates tab-delimited, "," indicates comma delimited. Only necessary to specify if reading data in from physical directory.

header

Logical. Indicate TRUE for data files with a header. Only necessary to specify if reading data in from physical directory.

ar

Logical. If TRUE, begins search for group model with autoregressive (AR) paths freed for estimation. Defaults to TRUE.

plot

Logical. If TRUE, graphs depicting relations among variables of interest will automatically be created. Solid lines represent contemporaneous relations (lag 0) and dashed lines reflect lagged relations (lag 1). For individual-level plots, red paths represent positive weights and blue paths represent negative weights. Width of paths corresponds to estimated path weight. For the group-level plot, black represents group-level paths, grey represents individual-level paths, and (if subgroup = TRUE) green represents subgroup-level paths. For the group-level plot, the width of the edge corresponds to the count. Defaults to TRUE.

subgroup

Logical. If TRUE, subgroups are generated based on similarities in model features using the walktrap.community function from the igraph package. Defaults to TRUE.

confirm_subgroup

Dataframe. If subgroup is also TRUE, option to provide subgroup labels contained in the dataframe. Dataframe has 2 columns, the first referring to file labels, and the second an integer variable referring to subgroup label.

paths

lavaan-style syntax containing paths with which to begin model estimation (optional). That is, Y~X indicates that Y is regressed on X, or X predicts Y. If no header is used, then variables should be referred to with V followed (with no separation) by the column number. If a header is used, variables should be referred to using variable names. To reference lag variables, "lag" should be added to the end of the variable name with no separation. Defaults to NULL.

exogenous

Vector of variable names to be treated as exogenous (optional). That is, exogenous variable X can predict Y but cannot be predicted by Y. If no header is used, then variables should be referred to with V followed (with no separation) by the column number. If a header is used, variables should be referred to using variable names. Defaults to NULL.

groupcutoff

Cutoff value for group-level paths. Defaults to .75, indicating that a path must be significant across 75% of individuals to be included as a group-level path.

subcutoff

Cutoff value for subgroup- level paths. Defaults to .5, indicating that a path must be significant across at least 50% of the individuals in a subgroup to be considered a subgroup-level path.

diagnos

In development. Defaults to FALSE.

Details

In main output directory:

In subgroup output directory (if subgroup = TRUE):

Note: if a subgroup of size n = 1 is discovered, subgroup-level output is not produced.
In individual output directory (where id represents the original file name for each individual):

Author(s)

Stephanie Lane

References

Gates, K.M. & Molenaar, P.C.M. (2012). Group search algorithm recovers effective connectivity maps for individuals in homogeneous and heterogeneous samples. NeuroImage, 63, 310-319.

Lane, S.T. & Gates, K.M. (2017). Automated selection of robust individual-level structural equation models for time series data. Structural Equation Modeling.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
 ## Not run: 
paths <- 'V2 ~ V1
          V3 ~ V4lag'

fit <- gimmeSEM(data     = simData,
                out      = "C:/simData_out",
                subgroup = TRUE, 
                paths    = paths)

print(fit, mean = TRUE)
print(fit, subgroup = 1, mean = TRUE)
print(fit, file = "group_1_1", estimates = TRUE)
print(fit, subgroup = 2, fitMeasures = TRUE)
plot(fit, file = "group_1_1")
 
## End(Not run)

gimme documentation built on Nov. 17, 2017, 5:04 a.m.