Giter VIP home page Giter VIP logo

gimme's Introduction

Group Iterative Multiple Model Estimation (GIMME)

The GIMME algorithm is a continually maintained R package, gimme.

For up-to-date tutorials for both new and old options, check out our online gimme tutorials and CRAN documentation .

Program developers are invited to submit changes here at the GitHub repository.

The Basics

  • GIMME can be used to estimate the unified SEM (uSEM; Kim et al., 2007; Gates et al., 2010).

  • Missing data is not a problem.

  • Heterogeneous data is not a problem:

    • No "group" or "common" structure will be forced unless it truly describes the majority.

    • Individual-level nuances will surface after a group or common structure is fit (provided one exists).

    • If desired, subgroups of individuals with similar patterns of effects will be generated to aid the researcher in finding similar patterns among the varied individual models.

  • Works well with as little as 3 or as many as 20 variables.

  • Can be freely downloaded by installing the package "gimme" in R.

Running GIMME

1. Create two new folders (i.e., directories)

  • Create a source folder for your time series. This can be anywhere that you have permission to read and write.

  • Nothing can be in the source folder other than the time series data.

  • Create an output folder for your results. This must be different from the above folder.

2. Extract the time series for your variables

  • Have each variable be a column, with the rows being the observation (e.g., scan in fMRI or a day in daily diary studies).

  • Substitute NA for missing values.

  • Have a separate file for each individual/session.

  • Put each file in the source folder you created in step 1. Do not put anything else in this folder.

  • Files must be either comma, space, or tab delimited.

3. Installing gimme with R

  • Open an R script and enter into the console: install.packages("gimme")

  • Once gimme has been installed, you will need to load the package by entering: library(gimme)

4. Running gimme

The gimme (or equivalently, gimmeSEM) function requires that you input:

  • The path to the directory containing your data

  • How data are separated (e.g., comma-separated values)

  • Whether the data files contain a header row

All other fields are optional and will go to defaults if no user input is provided. If no output directory is indicated, all information is stored as R objects (see tutorial linked above for details).

fit <- gimme(         # can use "gimme" or "gimmeSEM"
  data = '',          # source directory where your data are 
  out = '',           # output directory where you'd like your output to go
  sep = "",           # how data are separated. "" for space; "," for comma, "\t" for tab-delimited
  header = ,          # 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 = FALSE,   # TRUE or FALSE (default), cluster individuals based on similarities in effects
  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 = .5      # the proportion that is considered the majority at the subgroup level
)        

While gimme is running you will see information iterate in the command window. The algorithm will tell you when it is finished.

Output

  • The output directory will contain:

    • indivPathEstimates: Contains estimate, standard error, p-value, and z-value for each path and each individual

    • summaryFit: Contains model fit information for individual-level models. If subgroups are requested, this file also indicates 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.

    • summaryPathPlots: 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.

  • The subgroup output directory (if subgroup = TRUE) will contain:

    • 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. Subgroups of size one can be considered outlier cases

  • 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.

FAQ

How many time points do I need? This is a difficult question since it will be related to the number of variables you are using. Rules of thumb for any analysis can generally be used: the more the better! Having at least 100 time points is recommended, but adequate results have been obtained in simulation studies with only T = 60.

Do all individuals have to have the same number of observations (T)? No.

How many people do I need in my sample? For regular gimme, reliable results are obtained with as few as 10 participants. Remember that in this context, power to detect effects is determined by the number of time points rather than the number of individuals. Still, having at least 10 individuals helps gimme to detect signal from noise by looking for effects that consistently occur.

What do I do if I obtain an error? Do some initial trouble-shooting. 1. Ensure that all of your individuals have the same number of variables (columns) in their data sets. 2. Ensure that all variables have variability (i.e., are not constant). gimme will let you know if this is the case. 3. Ensure your path directories are correct. 4. Ensure that the columns are variables and the rows contain the observations across time. 5. If all of this is correct, please email the error you received, code used to run gimme, and the data (we promise not to use it or share it) to: [email protected].

gimme's People

Contributors

carizmendi avatar cjurban avatar ecmerkle avatar grantaking avatar jpark93 avatar kaduffy avatar kgates avatar lluo0 avatar michaelhallquist avatar secastroal avatar stlane avatar trh3 avatar zackfisher avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gimme's Issues

Replacement error when using subgroup option

Dear Experts,

I am trying to use GIMME on a dataset of 270 individuals. When running the analysis with subgroup=FALSE, everything works fine.

However, when I run it with subgroup=TRUE, I keep getting this error:

(...)
group-level pruning, subject 268 (...)
group-level pruning, subject 269 (...)
group-level pruning, subject 270 (...)
group-level pruning, subject 271 (...)
Error in $<-.data.frame(*tmp*, "ind_paths", value = list(NULL, NULL, :
replacement has 271 rows, data has 273

It seems that GIMME is somehow creating a duplicate subject, in my case I see the same file appear twice, for subject 265 and 266 and then it crashes with this error. Note that the subjects are 270, so it seems like it's creating more subjects somehow.

Could you please advise on how to handle this?

Thank you,

Leonardo Tozzi

Plotting

Hi,

Thank you for this nice package. I dont see any documentation with regards to plotting? I want to custom plots (e.g. plot only group and subgroup paths without individual paths).

Can you help?

Regards,
Bernard

A doubt on S-GIMME

Hi,

I would like to ask you if to implement the S-GIMME algorithm have I to use the same GIMME function (gimmeSEM) with possibly diferent options like subgroup and confirm_subgroup?

I ask about it, because this is the R package referred to in the paper Unsupervised Classification During Time-Series Model Building, where it is claimed that

S-GIMME is freely available within an R package (Lane, Gates, & Molenaar, 2016) .
Lane, S. T., Gates, K. M., & Molenaar, P. C. M. (2016). Gimme: Group iterative multiple model estimation [Computer Software]. Retrieved from https://CRAN.Rproject.org/package=gimme

Thank you!

Error in x$lhs

Hi,
I'm getting the following error when running gimme: Error in x$lhs : $ operator is invalid for atomic vectors. The error happens right at the beginning of the subgroup-level search. I'm using the following specifiers if that is helpful. I'm also using R 4.2.2 and updated the gimme package today

fit <- gimmeSEM(data = "/Users/lauramurray/Desktop/ROI_timecourses_Longitudinal",
out ="/Users/lauramurray/Desktop/output_longitudinal",
sep = ",",
ar = TRUE,
header = TRUE,
standardize = FALSE,
groupcutoff = .75,
plot = TRUE,
conv_length = 16,
conv_interval = .72,
subgroup = TRUE,
subcutoff = .5)

$ operator error

Hi,
After installing the most current versions of R and R studio, I got the following error message when trying to run GIMME:

Error in x$lhs : $ operator is invalid for atomic vectors

Another user in my lab also got this error independently, so I suspect it might be some incompatibility deriving from the r update? Can someone please advise?

Thank you!!
Chuck

minor documentation error

In Running GIMME, Step 4 of README:

sep = "",           # how data are separated. "" for space; "," for comma, "/t" for tab-delimited

The character for tab-delimited files should be "\t"

Files names for files < 10 are only one digit - this makes it hard to properly order these values

Example: data 1-9 are all single digits (e.g., data1Betas.csv is lower than data10Betas.csv), and what ends up happening is these files are lower in the order in the output (e.g., data1Betas.csv is lower than data10Betas.csv). is it possible to add a leading 0 or number of 0's based on the number of files? (e.g., data01Betas.csv, data001Betas.csv, or data023Betas.csv) This would help keep track of the proper order of values and lining up participants with their respective behavioral data (e.g., demographic variable with the density of gimme network) as well as order inside the output csv files. As of now, I have to write additional code to add leading 0's to order these values - and I could see a situation where someone could mistakenly line up these values incorrectly and have inaccurate analyses.

FIR estimates for convolved variables

Thank you very much for making this tool available to the research community!

I would like to study directed connectivity in response to a task using fMRI, so I have used your GIMME algorithm using the conv_vars option for my events of interest.

First of all, could you please confirm that the variable to convolve should be a binary variable of the same length as the timeseries, which in turn should be equal to the number of fMRI volumes acquired? This variable would have 1 for the volumes where the event is present and 0 in the ones where it's not. Is this correct?

I also have a second question: GIMME uses FIR to fit a hemodynamic response at the subject level. How can I inspect the parameter estimates for this FIR at the single subject level (or at the group level)? Are these stored?

Thank you very much!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.