# CS-GIMME Tutorial

#### Lan Luo & Teague Henry

#### November 7, 2018

## CS-GIMME

Confirmatory Subgroup GIMME enables researches to conduct GIMME both on the entire group as well as within predefined (e.g., observed) subgroups, such as clinical populations or biological sex. This allows for researchers to identify aspects of dynamic processes that are shared across the subgroups (i.e., group-level paths) as well as how the subgroups differ (i.e., subgroup-level paths). This document is a brief tutorial on using CS-GIMME, and contains several functions for extracting significantly different group paths. For a tutorial for the GIMME algorithm in general, see http://gimme.web.unc.edu/63-2/.

A sample dataset can be found at https://github.com/kgates/gimme/blob/master/Example%20Data.zip. In this dataset, each separate file is for each individual/session, each variable is a column and the rows are the observations. Following setting up the GIMME directories and organizing one’s variable timeseries, to use CS-GIMME, one needs to create an additional data frame that contains the subgroup information. This data frame must contain two columns. The first column contains the names of each subject variable timeseries file, sans extension. For example, for our sample dataset, the first time series file is labeled ‘group_1_1.txt’, the correct labeling in the data frame would be ‘group_1_1’. The second column contains integer valued subgroup labels. A dataframe that contains the subgroup information for our sample dataset can be made using the following code:

    install.packages("tools") #to use the function to get file names sans extension
    #get filenames in the folder without extension
    filename <- file_path_sans_ext(list.files(path = "t_120_n_25_v_5", full.names = FALSE))
    subgroup <- c(1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2) #create the subgroup
    confirm_dataframe <- data.frame(filename, subgroup)              #create the dataframe

When running CS-GIMME, this source folder should include nothing other than the time series data. The researcher can either specify an output directory (as shown below) or store the output as an object. Once the dataframe is created, CS-GIMME using this sample dataset can be run using the following code:

    gimme(                  # can use "gimme" or "gimmeSEM"
        data = 't_120_n_25_v_5',          # source directory where your data are
        out = 'SampleOutput',            # output directory where you'd like your output to go
        sep = ",",           # how data are separated. "" for space; "," for comma, "/t" for tab-delimited
        header = FALSE,          # TRUE or FALSE, is there a header
        ar = TRUE,          # TRUE (default) or FALSE, start with autoregressive paths open
        plot = TRUE,        # TRUE (default) or FALSE, generate plots
        subgroup = TRUE,    # Must be TRUE to perform confirmatory subgrouping
        confirm_subgroup = confirm_dataframe, # confirm_dataframe is the dataframe constructed previously
        paths = NULL,       # option to list paths that will be group-level (semi-confirmatory)
        groupcutoff = .75,  # the proportion that is considered the majority at the group level
        subcutoff = .75      # the proportion that is considered the majority at the subgroup level
        )