dynEGA | R Documentation |
Estimates dynamic communities in multivariate time series (e.g., panel data, longitudinal data, intensive longitudinal data) at multiple time scales and at different levels of analysis: individuals (intraindividual structure), groups, and population (interindividual structure)
dynEGA(
data,
id = NULL,
group = NULL,
n.embed = 5,
tau = 1,
delta = 1,
use.derivatives = 1,
level = c("individual", "group", "population"),
corr = c("auto", "cor_auto", "pearson", "spearman"),
na.data = c("pairwise", "listwise"),
model = c("BGGM", "glasso", "TMFG"),
algorithm = c("leiden", "louvain", "walktrap"),
uni.method = c("expand", "LE", "louvain"),
ncores,
verbose = TRUE,
...
)
data |
Matrix or data frame. Participants and variable should be in long format such that row t represents observations for all variables at time point t for a participant. The next row, t + 1, represents the next measurement occasion for that same participant. The next participant's data should immediately follow, in the same pattern, after the previous participant
For groups, Arguments A measurement occasion variable is not necessary and should be removed from the data before proceeding with the analysis |
id |
Numeric or character (length = 1).
Number or name of the column identifying each individual.
Defaults to |
group |
Numeric or character (length = 1).
Number of the column identifying group membership.
Defaults to |
n.embed |
Numeric (length = 1).
Defaults to |
tau |
Numeric (length = 1).
Defaults to |
delta |
Numeric (length = 1).
Defaults to |
use.derivatives |
Numeric (length = 1).
Defaults to
Generally recommended to leave "as is" |
level |
Character vector (up to length of 3). A character vector indicating which level(s) to estimate:
|
corr |
Character (length = 1).
Method to compute correlations.
Defaults to
For other similarity measures, compute them first and input them
into |
na.data |
Character (length = 1).
How should missing data be handled?
Defaults to
|
model |
Character (length = 1).
Defaults to
|
algorithm |
Character or
|
uni.method |
Character (length = 1).
What unidimensionality method should be used?
Defaults to
|
ncores |
Numeric (length = 1).
Number of cores to use in computing results.
Defaults to If you're unsure how many cores your computer has,
then type: |
verbose |
Boolean (length = 1).
Should progress be displayed?
Defaults to |
... |
Additional arguments to be passed on to
|
Derivatives for each variable's time series for each participant are
estimated using generalized local linear approximation (see glla
).
EGA
is then applied to these derivatives to model how variables
are changing together over time. Variables that change together over time are detected
as communities
A list containing:
Derivatives |
A list containing:
|
dynEGA |
A list containing:
|
Hudson Golino <hfg9s at virginia.edu> and Alexander P. Christensen <alexpaulchristensen@gmail.com>
Generalized local linear approximation
Boker, S. M., Deboeck, P. R., Edler, C., & Keel, P. K. (2010)
Generalized local linear approximation of derivatives from time series. In S.-M. Chow, E. Ferrer, & F. Hsieh (Eds.),
The Notre Dame series on quantitative methodology. Statistical methods for modeling human dynamics: An interdisciplinary dialogue,
(p. 161-178). Routledge/Taylor & Francis Group.
Deboeck, P. R., Montpetit, M. A., Bergeman, C. S., & Boker, S. M. (2009) Using derivative estimates to describe intraindividual variability at multiple time scales. Psychological Methods, 14(4), 367-386.
Original dynamic EGA implementation
Golino, H., Christensen, A. P., Moulder, R. G., Kim, S., & Boker, S. M. (2021).
Modeling latent topics in social media using Dynamic Exploratory Graph Analysis: The case of the right-wing and left-wing trolls in the 2016 US elections.
Psychometrika.
Time delay embedding procedure
Savitzky, A., & Golay, M. J. (1964).
Smoothing and differentiation of data by simplified least squares procedures.
Analytical Chemistry, 36(8), 1627-1639.
plot.EGAnet
for plot usage in EGAnet
# Population structure
simulated_population <- dynEGA(
data = sim.dynEGA, level = "population"
# uses simulated data in package
# useful to understand how data should be structured
)
# Group structure
simulated_group <- dynEGA(
data = sim.dynEGA, level = "group"
# uses simulated data in package
# useful to understand how data should be structured
)
## Not run:
# Individual structure
simulated_individual <- dynEGA(
data = sim.dynEGA, level = "individual",
ncores = 2, # use more for quicker results
verbose = TRUE # progress bar
)
# Population, group, and individual structure
simulated_all <- dynEGA(
data = sim.dynEGA,
level = c("individual", "group", "population"),
ncores = 2, # use more for quicker results
verbose = TRUE # progress bar
)
# Plot population
plot(simulated_all$dynEGA$population)
# Plot groups
plot(simulated_all$dynEGA$group)
# Plot individual
plot(simulated_all$dynEGA$individual, id = 1)
# Step through all plots
# Unless `id` is specified, 4 random IDs
# will be drawn from individuals
plot(simulated_all)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.