Learn R Programming

gimme (version 0.1-1)

aggregate: Group-level structural equation model search.

Description

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

Usage

aggregate(data = "", 
          sep = "", 
          header = , 
          out = "",
          ar = FALSE, 
          plot = TRUE)

Arguments

data
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.
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.
out
The path to the directory where the results will be stored. This directory must be generated by the user prior to running the function.
ar
Logical. If TRUE, begins search for group model with autoregressive (AR) paths open. Defaults to FALSE.
plot
Logical. If TRUE, graphs depicting relations among variables of interest will automatically be created. Defaults to TRUE.

Value

  • all.elementsContains estimate, standard error, and p value for estimated paths.
  • all.fitContains model fit information for group-level model.

Examples

Run this code
data(ts1,ts2,ts3,ts4,ts5)
input.path <- paste(file.path(tempdir()),"/input",sep="")
dir.create(input.path)
output.path <- paste(file.path(tempdir()),"/output",sep="")
dir.create(output.path)
write.table(ts1,paste(input.path,"/ts1.txt",sep=""),col.names=FALSE,row.names=FALSE)
write.table(ts2,paste(input.path,"/ts2.txt",sep=""),col.names=FALSE,row.names=FALSE)
write.table(ts3,paste(input.path,"/ts3.txt",sep=""),col.names=FALSE,row.names=FALSE)
write.table(ts4,paste(input.path,"/ts4.txt",sep=""),col.names=FALSE,row.names=FALSE)
write.table(ts5,paste(input.path,"/ts5.txt",sep=""),col.names=FALSE,row.names=FALSE)
aggregate.out <- aggregate(data = input.path,
                 sep = "",
                 header = FALSE,
                 out = output.path,
                 ar = TRUE,
                 plot = TRUE)

Run the code above in your browser using DataLab