mlGVAR {modnets} | R Documentation |
Fit GVAR models with multilevel data
Description
Fits a graphical vector autoregressive model to data containing multiple time points measured for multiple individuals.
Usage
mlGVAR(
data,
m = NULL,
selectFUN = NULL,
subjectNets = FALSE,
idvar = "ID",
exogenous = TRUE,
center = TRUE,
scale = TRUE,
fixedType = "g",
betweenType = "g",
centerWithin = TRUE,
scaleWithin = FALSE,
rule = "OR",
threshold = "none",
verbose = TRUE,
pcor = FALSE,
fixedArgs = NULL,
betweenArgs = NULL,
bm = FALSE,
beepno = NULL,
dayno = NULL,
deleteMissing = TRUE,
...
)
Arguments
data |
|
m |
Character vector or numeric vector indicating the moderator(s), if
any. Can also specify |
selectFUN |
Choose a variable selection function. Can specify either
|
subjectNets |
If |
idvar |
Character string to indicate which variable contains the participant identification numbers. |
exogenous |
Logical. Indicates whether moderator variables should be
treated as exogenous or not. If they are exogenous, they will not be
modeled as outcomes/nodes in the network. If the number of moderators
reaches |
center |
Logical. Determines whether to mean-center the variables. |
scale |
Logical. Determines whether to standardize the variables. |
fixedType |
If logical, then any variable selection procedure specified
by |
betweenType |
If logical, then any variable selection procedure
specified by |
centerWithin |
Following the application of |
scaleWithin |
Following the application of |
rule |
Only applies to the between-subject network when a threshold is
supplied. The |
threshold |
Logical or numeric. If |
verbose |
Logical. Determines whether to output progress bars and messages in the console during the fitting process. |
pcor |
See corresponding argument in the |
fixedArgs |
A named list of arguments for the variable selection function can be provided here, specifically those that are meant to be applied to the SUR network estimation. |
betweenArgs |
A named list of arguments for the variable selection function can be provided for the between-subjects network. |
bm |
Logical. Determines whether the same moderators are applied in the
between-subjects network. By default, the value of |
beepno |
Character string or numeric value to indicate which variable
(if any) encodes the survey number within a single day. Must be used in
conjunction with |
dayno |
Character string or numeric value to indiciate which variable
(if any) encodes the survey number within a single day. Must be used in
conjunction with |
deleteMissing |
Logical. Determines whether to automatically perform listwise deletion if there are any missing values in the dataset. |
... |
Additional arguments. |
Details
Uses a pseudo-mixed effects approach, wherein fixed effects are estimated and random effects are approximated. See the work of Epskamp et al. (2018) for more details on how these types of effects are estimated.
Value
mlGVAR
objects
References
Epskamp, S., Waldorp, L. J., Mottus, R., & Borsboom, B. (2018). The gaussian graphical model in cross-sectional and time-series data. Multivariate Behavioral Research. 53, 453-580.
See Also
mlGVARsim, lmerVAR, fitNetwork,
varSelect, resample, net, netInts,
plotNet
Examples
fit1 <- mlGVAR(mlgvarDat, 'M')
fit2 <- mlGVAR(mlgvarDat, 'M', bm = TRUE) # Fit the same moderator in the between-subjects network
fit3 <- mlGVAR(mlgvarDat, 'M', selectFUN = 'varSelect')