Learn R Programming

gimme (version 0.1-7)

gimmeSEM: Group iterative multiple model estimation.

Description

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

Usage

gimmeSEM(data  = "", out  = "", sep  = "", header  = , ar  = TRUE, plot  = TRUE, subgroup = FALSE, paths  = NULL, groupcutoff = .75, subcutoff  = .5, deconvolve_hrf = FALSE, control  = NULL, diagnos  = FALSE)

Arguments

data
The path to the directory where the data files are located. Each file 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.
out
The path to the directory where the results will be stored. This must be generated by the user prior to running the function.
sep
The spacing of the data files. "" indicates space-delimited, "/t" indicates tab-delimited, "," indicates comma delimited.
header
Logical. Indicate TRUE for data files with a header.
ar
Logical. If TRUE, begins search for group model with autoregressive (AR) paths open. Defaults to TRUE.
plot
Logical. If TRUE, graphs depicting relations among variables of interest will automatically be created. For individual-level plots, red paths represent positive weights and blue paths represent negative weights. 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.
paths
lavaan-style syntax containing paths with which to begin model estimation. 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.
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.
deconvolve_hrf
In development. Defaults to FALSE.
control
In development. Defaults to NULL.
diagnos
In development. Defaults to FALSE.

Details

In main output directory:
  • indivPathEstimates Contains estimate, standard error, p-value, and z-value 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 individual-level.
  • summaryPathsPlot Produced if plot = TRUE. Contains figure with group, subgroup (if subgroup = TRUE), and individual-level paths for the sample. Black paths are group-level, green paths are subgroup-level, and grey paths are individual-level, 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 group-level paths, grey represents individual-level paths, and green represents subgroup-level paths.

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):

  • idBetas Contains individual-level estimates of each path for each individual.
  • idStdErrors Contains individual-level standard errors for each path for each individual.
  • idPlot Contains individual-level plots. Red paths represent positive weights and blue paths represent negative weights.

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.

Examples

Run this code
 ## Not run: 
# paths <- 'V2 ~ V1
#           V3 ~ V4lag'
# 
# gimmeSEM(data     = "C:/data100",
#          out      = "C:/data100_gimme_out",
#          sep      = ",",
#          header   = FALSE,
#          ar       = TRUE,
#          plot     = TRUE,
#          paths    = paths,
#          subgroup = FALSE)
#  ## End(Not run)

Run the code above in your browser using DataLab