Learn R Programming

gimme (version 0.2-2)

aggSEM: Group-level structural equation model search.

Description

Concatenates all individual-level data files and fits a group model to the data.

Usage

aggSEM(data   = "",
       out    = "",
       sep    = "",
       header = ,
       ar     = TRUE,
       plot   = TRUE,
       paths  = NULL)

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.

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 open. Defaults to TRUE.

plot

Logical. If TRUE, graphs depicting relations among variables of interest will automatically be created. For aggregate-level plot, red paths represent positive weights and blue paths represent negative weights. Defaults to TRUE.

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.

Details

In main output directory:

  • allBetas Matrix. Contains estimates for each path in the aggregate-level model. The row variable is the outcome and the column variable is the predictor variable.

  • allStdErrors Matrix. Contains standard errors for each path in the aggregate-level model. The row variable is the outcome and the column variable is the predictor variable.

  • allPathEstimates Contains estimate, standard error, p-value, and z-value for each path for the concatenated data.

  • summaryFit Contains model fit information for the aggregate-level model.

  • summaryPathsPlot Contains aggregate-level plot. Red paths represent positive weights and blue paths represent negative weights.

Examples

Run this code
# NOT RUN {
exFit <- aggSEM(data = ts)
# }
# NOT RUN {
plot(exFit)
# }

Run the code above in your browser using DataLab