ml_lvm: Multi-level latent variable model family

Description Usage Arguments Value Author(s)

View source: R/a_models_ml_lvm.R

Description

This family is the two-level random intercept variant of the lvm model family. It is mostly a special case of the dlvm1 family, with the addition of structural effects rather than temporal effects in the beta matrix.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
ml_lnm(...)
ml_rnm(...)
ml_lrnm(...)
ml_lvm(data, lambda, clusters, within_latent = c("cov",
                    "chol", "prec", "ggm"), within_residual = c("cov",
                    "chol", "prec", "ggm"), between_latent = c("cov",
                    "chol", "prec", "ggm"), between_residual = c("cov",
                    "chol", "prec", "ggm"), beta_within = "empty",
                    beta_between = "empty", omega_zeta_within = "full",
                    delta_zeta_within = "full", kappa_zeta_within =
                    "full", sigma_zeta_within = "full",
                    lowertri_zeta_within = "full", omega_epsilon_within =
                    "empty", delta_epsilon_within = "empty",
                    kappa_epsilon_within = "empty", sigma_epsilon_within =
                    "empty", lowertri_epsilon_within = "empty",
                    omega_zeta_between = "full", delta_zeta_between =
                    "full", kappa_zeta_between = "full",
                    sigma_zeta_between = "full", lowertri_zeta_between =
                    "full", omega_epsilon_between = "empty",
                    delta_epsilon_between = "empty", kappa_epsilon_between
                    = "empty", sigma_epsilon_between = "empty",
                    lowertri_epsilon_between = "empty", nu, nu_eta,
                    identify = TRUE, identification = c("loadings",
                    "variance"), vars, latents, groups, equal = "none",
                    baseline_saturated = TRUE, estimator = c("FIML",
                    "MUML"), optimizer, storedata = FALSE, verbose =
                    FALSE, standardize = c("none", "z", "quantile"),
                    sampleStats)

Arguments

data

A data frame encoding the data used in the analysis. Must be a raw dataset.

lambda

A model matrix encoding the factor loading structure. Each row indicates an indicator and each column a latent. A 0 encodes a fixed to zero element, a 1 encoding a free to estimate element, and higher integers encoding equality constrains. For multiple groups, this argument can be a list or array with each element/slice encoding such a matrix. Could also be the result of simplestructure.

clusters

A string indicating the variable in the dataset that describes group membership.

within_latent

The type of within-person latent contemporaneous model to be used.

within_residual

The type of within-person residual model to be used.

between_latent

The type of between-person latent model to be used.

between_residual

The type of between-person residual model to be used.

beta_within

A model matrix encoding the within-cluster structural. A 0 encodes a fixed to zero element, a 1 encoding a free to estimate element, and higher integers encoding equality constrains. For multiple groups, this argument can be a list or array with each element/slice encoding such a matrix. Defaults to "empty".

beta_between

A model matrix encoding the between-cluster structural. A 0 encodes a fixed to zero element, a 1 encoding a free to estimate element, and higher integers encoding equality constrains. For multiple groups, this argument can be a list or array with each element/slice encoding such a matrix. Defaults to "empty".

omega_zeta_within

Only used when within_latent = "ggm". Can be "full", "empty", or a typical model matrix with 0s indicating parameters constrained to zero, 1s indicating free parameters, and higher integers indicating equality constrains. For multiple groups, this argument can be a list or array with each element/slice encoding such a matrix.

delta_zeta_within

Only used when within_latent = "ggm". Can be "full", "empty", or a typical model matrix with 0s indicating parameters constrained to zero, 1s indicating free parameters, and higher integers indicating equality constrains. For multiple groups, this argument can be a list or array with each element/slice encoding such a matrix.

kappa_zeta_within

Only used when within_latent = "prec". Can be "full", "empty", or a typical model matrix with 0s indicating parameters constrained to zero, 1s indicating free parameters, and higher integers indicating equality constrains. For multiple groups, this argument can be a list or array with each element/slice encoding such a matrix.

sigma_zeta_within

Only used when within_latent = "cov". Can be "full", "empty", or a typical model matrix with 0s indicating parameters constrained to zero, 1s indicating free parameters, and higher integers indicating equality constrains. For multiple groups, this argument can be a list or array with each element/slice encoding such a matrix.

lowertri_zeta_within

Only used when within_latent = "chol". Can be "full", "empty", or a typical model matrix with 0s indicating parameters constrained to zero, 1s indicating free parameters, and higher integers indicating equality constrains. For multiple groups, this argument can be a list or array with each element/slice encoding such a matrix.

omega_epsilon_within

Only used when within_residual = "ggm". Can be "full", "empty", or a typical model matrix with 0s indicating parameters constrained to zero, 1s indicating free parameters, and higher integers indicating equality constrains. For multiple groups, this argument can be a list or array with each element/slice encoding such a matrix.

delta_epsilon_within

Only used when within_residual = "ggm". Can be "full", "empty", or a typical model matrix with 0s indicating parameters constrained to zero, 1s indicating free parameters, and higher integers indicating equality constrains. For multiple groups, this argument can be a list or array with each element/slice encoding such a matrix.

kappa_epsilon_within

Only used when within_residual = "prec". Can be "full", "empty", or a typical model matrix with 0s indicating parameters constrained to zero, 1s indicating free parameters, and higher integers indicating equality constrains. For multiple groups, this argument can be a list or array with each element/slice encoding such a matrix.

sigma_epsilon_within

Only used when within_residual = "cov". Can be "full", "empty", or a typical model matrix with 0s indicating parameters constrained to zero, 1s indicating free parameters, and higher integers indicating equality constrains. For multiple groups, this argument can be a list or array with each element/slice encoding such a matrix.

lowertri_epsilon_within

Only used when within_residual = "chol". Can be "full", "empty", or a typical model matrix with 0s indicating parameters constrained to zero, 1s indicating free parameters, and higher integers indicating equality constrains. For multiple groups, this argument can be a list or array with each element/slice encoding such a matrix.

omega_zeta_between

Only used when between_latent = "ggm". Can be "full", "empty", or a typical model matrix with 0s indicating parameters constrained to zero, 1s indicating free parameters, and higher integers indicating equality constrains. For multiple groups, this argument can be a list or array with each element/slice encoding such a matrix.

delta_zeta_between

Only used when between_latent = "ggm". Can be "full", "empty", or a typical model matrix with 0s indicating parameters constrained to zero, 1s indicating free parameters, and higher integers indicating equality constrains. For multiple groups, this argument can be a list or array with each element/slice encoding such a matrix.

kappa_zeta_between

Only used when between_latent = "prec". Can be "full", "empty", or a typical model matrix with 0s indicating parameters constrained to zero, 1s indicating free parameters, and higher integers indicating equality constrains. For multiple groups, this argument can be a list or array with each element/slice encoding such a matrix.

sigma_zeta_between

Only used when between_latent = "cov". Can be "full", "empty", or a typical model matrix with 0s indicating parameters constrained to zero, 1s indicating free parameters, and higher integers indicating equality constrains. For multiple groups, this argument can be a list or array with each element/slice encoding such a matrix.

lowertri_zeta_between

Only used when between_latent = "chol". Can be "full", "empty", or a typical model matrix with 0s indicating parameters constrained to zero, 1s indicating free parameters, and higher integers indicating equality constrains. For multiple groups, this argument can be a list or array with each element/slice encoding such a matrix.

omega_epsilon_between

Only used when between_residual = "ggm". Can be "full", "empty", or a typical model matrix with 0s indicating parameters constrained to zero, 1s indicating free parameters, and higher integers indicating equality constrains. For multiple groups, this argument can be a list or array with each element/slice encoding such a matrix.

delta_epsilon_between

Only used when between_residual = "ggm". Can be "full", "empty", or a typical model matrix with 0s indicating parameters constrained to zero, 1s indicating free parameters, and higher integers indicating equality constrains. For multiple groups, this argument can be a list or array with each element/slice encoding such a matrix.

kappa_epsilon_between

Only used when between_residual = "prec". Can be "full", "empty", or a typical model matrix with 0s indicating parameters constrained to zero, 1s indicating free parameters, and higher integers indicating equality constrains. For multiple groups, this argument can be a list or array with each element/slice encoding such a matrix.

sigma_epsilon_between

Only used when between_residual = "cov". Can be "full", "empty", or a typical model matrix with 0s indicating parameters constrained to zero, 1s indicating free parameters, and higher integers indicating equality constrains. For multiple groups, this argument can be a list or array with each element/slice encoding such a matrix.

lowertri_epsilon_between

Only used when between_residual = "chol". Can be "full", "empty", or a typical model matrix with 0s indicating parameters constrained to zero, 1s indicating free parameters, and higher integers indicating equality constrains. For multiple groups, this argument can be a list or array with each element/slice encoding such a matrix.

nu

Optional vector encoding the intercepts of the observed variables. Set elements to 0 to indicate fixed to zero constrains, 1 to indicate free intercepts, and higher integers to indicate equality constrains. For multiple groups, this argument can be a list or array with each element/column encoding such a vector.

nu_eta

Optional vector encoding the intercepts of the latent variables. Set elements to 0 to indicate fixed to zero constrains, 1 to indicate free intercepts, and higher integers to indicate equality constrains. For multiple groups, this argument can be a list or array with each element/column encoding such a vector.

identify

Logical, should the model be automatically identified?

identification

Type of identification used. "loadings" to fix the first factor loadings to 1, and "variance" to fix the diagonal of the latent variable model matrix (sigma_zeta, lowertri_zeta, delta_zeta or kappa_zeta) to 1.

vars

An optional character vector with names of the variables used.

latents

An optional character vector with names of the latent variables.

groups

An optional string indicating the name of the group variable in data.

equal

A character vector indicating which matrices should be constrained equal across groups.

baseline_saturated

A logical indicating if the baseline and saturated model should be included. Mostly used internally and NOT Recommended to be used manually.

estimator

Estimator used. Currently only "FIML" is supported.

optimizer

The optimizer to be used. Usually either "nlminb" (with box constrains) or "ucminf" (ignoring box constrains), but any optimizer supported by optimr can be used.

storedata

Logical, should the raw data be stored? Needed for bootstrapping (see bootstrap).

verbose

Logical, should progress be printed to the console?

standardize

Which standardization method should be used? "none" (default) for no standardization, "z" for z-scores, and "quantile" for a non-parametric transformation to the quantiles of the marginal standard normal distribution.

sampleStats

An optional sample statistics object. Mostly used internally.

...

Arguments sent to 'ml_lvm'

Value

An object of the class psychonetrics (psychonetrics-class)

Author(s)

Sacha Epskamp <mail@sachaepskamp.com>


psychonetrics documentation built on Oct. 26, 2021, 1:06 a.m.