mlGVARsim {modnets} | R Documentation |
Main workhorse for simulating VAR and mlGVAR data
Description
Affords the generation of simulated data containing multiple timepoint measurements for a number of subjects. Can simulate data with a single moderator as well.
Usage
mlGVARsim(
nTime = 50,
nPerson = 10,
nNode = 3,
m = NULL,
m2 = 0.25,
m1 = 0.7,
m0 = 1,
lag = 1,
thetaVar = NULL,
mu_SD = NULL,
init_beta_SD = NULL,
fixedMuSD = 1,
shrink_fixed = 0.9,
propPos = 0.5,
m1SD = 0.1,
m2SD = 0.1,
m1_range = NULL,
m2_range = NULL,
shrink_deviation = 0.9,
getM = FALSE,
contemporaneous = "wishart",
GGMsparsity = 0.5,
mcenter = TRUE,
skew = FALSE,
skewErr = FALSE,
ordinal = FALSE,
nLevels = 5,
ordWithin = TRUE,
minOrd = 3,
thresholds = NULL,
mseed = NULL,
onlyNets = FALSE,
modType = "none"
)
Arguments
nTime |
Numeric value. The number of timepoints to simulate for each individual. |
nPerson |
The number of subjects to create data for. Can set to |
nNode |
The number of nodes/variables to simulate. Does not include a moderator if one is specified. |
m |
Logical. If |
m2 |
Numeric. If |
m1 |
Functions similarly to |
m0 |
Only relevant when |
lag |
Numeric value, supposed to indicate the number of lags to simulate
models parameters for. Recommended to leave at |
thetaVar |
Numeric vector containing the variance associated with each
node (excluding the moderator) in the contemporaneous network. If
|
mu_SD |
Numeric vector of length 2. The first value determines the standard deviation of the means associated with the temporal data, and the second value determines the standard deviations of the means associated with the between-subjects network. |
init_beta_SD |
Similar to |
fixedMuSD |
Standard deviation of the random values for the means of the fixed effects. |
shrink_fixed |
Numeric value to determine the factor by which to shrink sampled beta coefficients for fixed effects. Value between 0 and 1, where higher values are recommended. |
propPos |
The proportion of edges with a positive sign. |
m1SD |
Standard deviation of the moderator main effect coefficients. |
m2SD |
Standard deviation of the moderator interaction effect coefficients. |
m1_range |
Numeric vector of length 2. The range of values for moderator main effect coefficients. |
m2_range |
Numeric vector of length 2. The range of values for moderator interaction effect coefficients. |
shrink_deviation |
Numeric value to determine the factor by which to shrink contemporaneous coefficients. Value between 0 and 1, where higher values are recommended. |
getM |
If |
contemporaneous |
Options include |
GGMsparsity |
Numeric value between 0 and 1. Determines the sparsity of sampled network matrices. |
mcenter |
If |
skew |
If |
skewErr |
The skewness parameter for the |
ordinal |
Logical. Determines whether to sample ordinal variables. If a
numeric value is provided, then this will automatically be assigned to the
|
nLevels |
Number of levels for the ordinal variables. Only relevant if
|
ordWithin |
If |
minOrd |
The minimum number of unique values allowed for each variable. |
thresholds |
List of length |
mseed |
Numeric value for the seed to be set when |
onlyNets |
If |
modType |
Determines the type of moderation to employ, such as
|
Details
Made to simulate data based on pre-specified parameters, possibly for power
simulations or other analyses. Output can be used to fit models with either
mlGVAR
or lmerVAR
.
Value
Simulated mlGVAR or VAR data.
See Also
mlGVAR, lmerVAR, simNet, plotNet,
net, netInts
Examples
set.seed(1)
x <- mlGVARsim(nTime = 50, nPerson = 10, nNode = 3, m = TRUE)