Description Usage Arguments Details Author(s) References Examples
This function identifies structural equation models for each individual that consist of both grouplevel and individuallevel paths.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21  gimmeSEM(data = "",
out = "",
sep = "",
header = ,
ar = TRUE,
plot = TRUE,
subgroup = FALSE,
sub_feature = "lag & contemp",
confirm_subgroup = NULL,
paths = NULL,
exogenous = NULL,
ex_lag = FALSE,
conv_vars = NULL,
conv_length = 16,
conv_interval = 1,
mult_vars = NULL,
mean_center_mult = FALSE,
standardize = FALSE,
groupcutoff = .75,
subcutoff = .5,
diagnos = FALSE)

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 spacedelimited, "/t" indicates tabdelimited, "," 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 individuallevel plots, red paths represent positive weights and blue paths represent negative weights. Width of paths corresponds to estimated path weight. For the grouplevel plot, black represents grouplevel paths, grey represents individuallevel paths, and (if subgroup = TRUE) green represents subgrouplevel paths. For the grouplevel 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 
sub_feature 
Option to indicate feature(s) used to subgroup individuals. Defaults to "lag & contemp" for lagged and contemporaneous, which is the original method. Can use "lagged" or "contemp" to subgroup solely on features related to lagged and contemporaneous relations, respectively. 
confirm_subgroup 
Dataframe. Option only available when subgroup = TRUE. Dataframe should contain two columns. The first
column should specify file labels (the name of the data files without file extension),
and the second should contain integer values (beginning at 1)
specifying the subgroup membership for each individual.
function from the 
paths 

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. 
ex_lag 
Logical. If true, lagged variables are created for exogenous variables. Defaults to FALSE. 
conv_vars 
Vector of variable names to be convolved via smoothed Finite Impulse Response (sFIR). Defaults to NULL. 
conv_length 
Expected response length in seconds. For functional MRI BOLD, 16 seconds (default) is typical for the hemodynamic response function. 
conv_interval 
Interval between data acquisition. Currently must be a constant. For fMRI studies, this is the repetition time. Defaults to 1. 
mult_vars 
Vector of variable names to be multiplied to explore bilinear/modulatory effects (optional). All multiplied variables will be treated as exogenous (X can predict Y but cannot be predicted by Y). Within the vector, multiplication of two variables should be indicated with an asterik (e.g. V1*V2). If no header is used, variables should be referred to with V followed by the column number (with no separation). If a header is used, each variable should be referred to using variable names. If multiplication with the lag 1 of a variable is desired, the variable name should be followed by "lag" with no separation (e.g. V1*V2lag). Note that if multiplied variables are desired, at least one variable in the dataset must be specified as exogenous. Defaults to NULL. 
mean_center_mult 
Logical. If TRUE, the variables indicated in mult_vars will be meancentered before being multiplied together. Defaults to FALSE. 
standardize 
Logical. If TRUE, all variables will be standardized to have a mean of zero and a standard deviation of one. Defaults to FALSE. 
groupcutoff 
Cutoff value for grouplevel paths. Defaults to .75, indicating that a path must be significant across 75% of individuals to be included as a grouplevel 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 subgrouplevel path. 
diagnos 
In development. Defaults to FALSE. 
In main output directory:
indivPathEstimates Contains estimate, standard error, pvalue, and zvalue for each path for each individual. If subgroup = TRUE and subgroups are found, then a column is present containing the subgroup membership for each individual. Also contains the level at which each path was estimated: group, subgroup, or individual.
summaryFit Contains model fit information for individual level models. If subgroups are requested, this file also contains the subgroup membership for each individual.
summaryPathCountMatrix Contains counts of total number of paths, both contemporaneous and lagged, estimated for the sample. The row variable is the outcome and the column variable is the predictor variable.
summaryPathCounts Contains summary count information for paths identified at the group, subgroup (if subgroup = TRUE), and individuallevel.
summaryPathsPlot Produced if plot = TRUE. Contains figure with group, subgroup (if subgroup = TRUE), and individuallevel paths for the sample. Black paths are grouplevel, green paths are subgrouplevel, and grey paths are individuallevel, where the thickness of the line represents the count.
In subgroup output directory (if subgroup = TRUE):
subgroupkPathCounts Contains counts of relations among lagged and contemporaneous variables for the kth subgroup.
subgroupkPlot Contains plot of group, subgroup, and individual level paths for the kth subgroup. Black represents grouplevel paths, grey represents individuallevel paths, and green represents subgrouplevel paths.
Note: if a subgroup of size n = 1 is discovered, subgrouplevel output is
not produced.
In individual output directory (where id represents the
original file name for each individual):
idBetas Contains individuallevel estimates of each path for each individual.
idStdErrors Contains individuallevel standard errors for each path for each individual.
idPlot Contains individuallevel plots. Red paths represent positive weights and blue paths represent negative weights.
Stephanie Lane
Gates, K.M. & Molenaar, P.C.M. (2012). Group search algorithm recovers effective connectivity maps for individuals in homogeneous and heterogeneous samples. NeuroImage, 63, 310319.
Lane, S.T. & Gates, K.M. (2017). Automated selection of robust individuallevel structural equation models for time series data. Structural Equation Modeling.
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)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.