EGM | R Documentation |
Function to fit the Exploratory Graph Model
EGM(
data,
EGM.model = c("standard", "EGA"),
communities = NULL,
structure = NULL,
search = FALSE,
p.in = NULL,
p.out = NULL,
opt = c("AIC", "BIC", "CFI", "chisq", "logLik", "RMSEA", "SRMR", "TEFI", "TEFI.adj",
"TLI"),
constrained = TRUE,
verbose = TRUE,
...
)
data |
Matrix or data frame. Should consist only of variables to be used in the analysis. Can be raw data or a correlation matrix |
EGM.model |
Character vector (length = 1).
Sets the procedure to conduct
|
communities |
Numeric vector (length = 1).
Number of communities to use for the |
structure |
Numeric or character vector (length = |
search |
Boolean (length = 1).
Whether a search over parameters should be conducted.
Defaults to |
p.in |
Numeric vector (length = 1).
Probability that a node is randomly linked to other nodes in the same community.
Within community edges are set to zero based on |
p.out |
Numeric vector (length = 1).
Probability that a node is randomly linked to other nodes not in the same community.
Between community edges are set to zero based on |
opt |
Character vector (length = 1).
Fit index used to select from when searching over models
(only applies to
Defaults to |
constrained |
Boolean (length = 1).
Whether memberships of the communities should
be added as a constraint when optimizing the network loadings.
Defaults to |
verbose |
Boolean (length = 1).
Should progress be displayed?
Defaults to |
... |
Additional arguments to be passed on to
|
Hudson F. Golino <hfg9s at virginia.edu> and Alexander P. Christensen <alexpaulchristensen@gmail.com>
# Get depression data
data <- depression[,24:44]
# Estimate EGM (using EGA)
egm_ega <- EGM(data)
# Estimate EGM (using EGA) specifying communities
egm_ega_communities <- EGM(data, communities = 3)
# Estimate EGM (using EGA) specifying structure
egm_ega_structure <- EGM(
data, structure = c(
1, 1, 1, 2, 1, 1, 1,
1, 1, 1, 3, 2, 2, 2,
2, 3, 3, 3, 3, 3, 2
)
)
# Estimate EGM (using standard)
egm_standard <- EGM(
data, EGM.model = "standard",
communities = 3, # specify number of communities
p.in = 0.95, # probability of edges *in* each community
p.out = 0.80 # probability of edges *between* each community
)
## Not run:
# Estimate EGM (using EGA search)
egm_ega_search <- EGM(
data, EGM.model = "EGA", search = TRUE
)
# Estimate EGM (using EGA search and AIC criterion)
egm_ega_search_AIC <- EGM(
data, EGM.model = "EGA", search = TRUE, opt = "AIC"
)
# Estimate EGM (using search)
egm_search <- EGM(
data, EGM.model = "standard", search = TRUE,
communities = 3, # need communities or structure
p.in = 0.95 # only need 'p.in'
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.