Fits a graphical vector autoregressive model to data containing multiple time points measured for multiple individuals.
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,
...
)
n x k
dataframe or matrix
Character vector or numeric vector indicating the moderator(s), if
any. Can also specify "all"
to make every variable serve as a
moderator, or 0
to indicate that there are no moderators. If the
length of m
is k - 1
or longer, then it will not be possible
to have the moderators as exogenous variables. Thus, exogenous
will
automatically become FALSE
.
Choose a variable selection function. Can specify either
"varSelect"
or "resample"
to use the corresponding functions.
If you want to use the resample
function though, then it is
recommended to specify selectFUN
as one of: "stability",
"split", "bootstrap"
in order to identify the specific method. If
selectFUN = "resample"
, then it is recommended to add the
sampMethod
argument to the call to mlGVAR
.
If TRUE
, then subject-specific networks are fit for
all subjects and returned in the final output. Otherwise, can specify a
single value or a vector of values to represent which subjects to return
individual networks for -- specifically, the SUR network. One caveat is
that variable selection methods are not applied to these subject-specific
networks. Further modeling could be done using the output, however.
Character string to indicate which variable contains the participant identification numbers.
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 k - 1
or k
, then exogenous
will automatically
be FALSE
.
Logical. Determines whether to mean-center the variables.
Logical. Determines whether to standardize the variables.
Following the application of center
and
scale
, this determines whether to center variables within individual
subjects to create subject-centered values.
Following the application of center
and
scale
, this determines whether to scale variables within individual
subjects to create subject-standardized values.
Only applies to the between-subject network when a threshold is
supplied. The "AND"
rule will only preserve edges when both
corresponding coefficients have p-values below the threshold, while the
"OR"
rule will preserve an edge so long as one of the two
coefficients have a p-value below the supplied threshold.
Logical or numeric. If TRUE
, then a default value of
.05 will be set. Indicates whether a threshold should be placed on the
models at each iteration of the sampling. A significant choice by the
researcher.
Logical. Determines whether to output progress bars and messages in the console during the fitting process.
See corresponding argument in the fitNetwork
function
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.
A named list of arguments for the variable selection function can be provided for the between-subjects network.
Logical. Determines whether the same moderators are applied in the
between-subjects network. By default, the value of m
only applies to
the SUR network. This allows one to decide whether or not to apply those
moderators in the between-subject network.
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
argument.
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 beepno
argument.
Logical. Determines whether to automatically perform listwise deletion if there are any missing values in the dataset.
Additional arguments.
mlGVAR
objects
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.
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.
mlGVARsim, lmerVAR, fitNetwork,
varSelect, resample, net, netInts,
plotNet
# NOT RUN {
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')
# }
Run the code above in your browser using DataLab