Lgc | R Documentation |
Some description
lgc(...)
lgc_dummy(...)
Lgc Class
lgc()
is a wrapper for the R6 class constructor
Lgc$new()
. See Lgc$new()
below for a list of arguments.
get_par_table
Read only. Retrieves the parameter table as tibble.
get_group_labels
Read only. Retrieves the group_labels.
expose
Read only. Returns the private structure of the object. For debugging purposes only.
get_hypotheses
Read only. Returns the list of hypotheses. For debugging purposes only.
get_par_labels
Read only. Returns an array of parameter labels used in the lavaan syntax.
get_sem_object
Read only. Returns the estimated lavaan SEM object.
new()
Prints coefficients for the Lgc object.
Lgc class constructor.
Lgc$new()
get_facet_grid()
Lgc$get_facet_grid()
has_latent_dv()
Lgc$has_latent_dv()
has_latent_covariate()
Lgc$has_latent_covariate()
has_covariate()
Lgc$has_covariate()
has_within()
Lgc$has_within()
has_resid_cov()
Lgc$has_resid_cov()
get_labels()
Lgc$get_labels( labels, parse_action = c("underscore", "empty", "remove"), format = c("plotmath", "text", "syntax"), sep = "," )
is_indicator()
Lgc$is_indicator(variables)
belongs_to()
Lgc$belongs_to(variables, whom)
get_etas_mmodel()
Lgc$get_etas_mmodel()
get_covariates_mmodel()
Lgc$get_covariates_mmodel()
is_latent()
Lgc$is_latent(variables)
specify()
Specifies an Lgc object.
Lgc$specify( data = NULL, etas, c_matrix_within, resid_cov = list(), equal_resid_cov = list(), invariance_within = "strong", compound_symmetry = FALSE, sphericity = list(), c_matrix_between = TRUE, invariance_between = "strong", covariates = NULL, fixed_covariates = TRUE, lv_scaling = "effect", group = NULL, group_labels = NULL, group_weights = "fixed", variance_homogeneity = FALSE, hypotheses = NULL, append = NULL, dummy = FALSE, verbose = FALSE, ... )
data
tibble. Will be converted to tibble if not already a tibble.
etas
Named list of character vectors of length q. Each list
element (character vector) represents an eta variable. The elements
of the character vector are manifest variables (i.e., indicators)
from the data set that measure the corresponding eta variable. The
list names correspond to the names of the eta variables.
E.g.:
etas = list(
eta1 = c("Y11", "Y12"),
eta2 = c("Y21", "Y22"),
eta3 = c("Y31", "Y32")
)
c_matrix_within
Numeric q x q matrix. Contrast matrix for the
within-subjects design. Must be a square matrix.
E.g.:
c_matrix_within = matrix(c(
1/3, -sqrt(1/2), sqrt(1/6),
1/3, 0, -sqrt(2/3),
1/3, sqrt(1/2), sqrt(1/6)
), nrow = 3)
resid_cov
List of character vectors. Each character vector contains manifest variables from the data set among which residual covariances should be implemented. Residual covariances can vary.
equal_resid_cov
List of character vectors. Each character vector contains manifest variables from the data set among which residual covariances should be implemented. Residual covariances are constrained to be equal.
invariance_within
Logical. Default is TRUE. Indicates whether strong measurement invariance across latent dependent variables eta should be imposed.
compound_symmetry
Logical. Indicates whether compound symmetry should be imposed.
sphericity
List of character vectors. Each character vector contains indices of pi variables among which sphericity should be imposed.
c_matrix_between
Numeric p x p matrix. Contrast matrix for the
between-subjects design. Must be a square matrix.
E.g.:
c_matrix_between = matrix(c(
1/3, -sqrt(1/2), sqrt(1/6),
1/3, 0, -sqrt(2/3),
1/3, sqrt(1/2), sqrt(1/6)
), nrow = 3)
invariance_between
Logical. Default is TRUE
.
Indicates whether measurement invariance across groups should be
imposed.
covariates
Named list of character vectors. Same format as the argument etas.
fixed_covariates
Logical. Indicates whether manifest covariates should be treated as fixed.
lv_scaling
Character. Possible values:
c("effect", "referent")
. Default is "effect". Scheme to
identify the latent variable scale. For "effect"
: effect coding
scheme freely estimates all loadings and intercepts of the indicators
and constraints the average of the loadings to 1 and the average of
the intercepts to 0. For "referent"
: referent indicator scheme
sets the first loading to 1 and the first intercept to 0.
group
Character. Contains the grouping variable from the data set.
group_labels
Character vector of length p. Contains unique group
names of the group variable from the data set. Optional, default is
NULL. If not supplied, labels will be pulled from the data set using
the provided group variable.
E.g.: groups = c("group1", "group2", "group3")
group_weights
Either numeric vector of length p (same length
as group_labels
) or one of the characters
c("fixed", "stochastic")
. Default is "fixed"
.
variance_homogeneity
Logical. Default is TRUE
.
Indicates whether homogeneity of variance should be imposed across
groups.
hypotheses
List of objects of class Hypothesis.
append
Character. lavaan syntax that is to be appended to the model string.
dummy
Logical. Indicates whether the model should be estimated.
verbose
Logical.
...
Additional arguments passed down to lavaan.
specify_dummy()
Lgc$specify_dummy( n_etas = 1, n_indicators_eta = 1, n_groups = 1, c_matrix_within = NULL, n_covariates = NULL, hypotheses = NULL, ... )
estimate()
Estimates the model.
Lgc$estimate(...)
...
Additional arguments.
get_lav_syntax()
Retrieves the lavaan syntax.
Lgc$get_lav_syntax(...)
...
Additional arguments.
get_estimates()
Returns the point estimates of the model.
Lgc$get_estimates( what = c("variance", "covariance", "intercept", "measurement", "resid_var", "resid_cov", "regression"), only_unique_labels = FALSE, ... )
what
Character vector.
only_unique_labels
Logical. Default is FALSE.
...
Additional arguments.
test()
Tests the provided hypothesis on the lgc object.
Lgc$test(hypothesis)
hypothesis
Object of class Hypothesis.
tests_table()
Tests multiple hypotheses on the lgc object and returns the results as a table.
Lgc$tests_table(hypotheses)
hypothesis
List of objects of class Hypothesis.
print()
Prints the lavaan object.
Lgc$print(...)
summary()
Prints a summary for the Lgc object.
Lgc$summary(fit_measures = T, anova = T, coefficients = T, ...)
fit_measures
Logical. Indicates whether fit measures should be printed.
detailed
Logical. Indicates whether a detailed summary should be printed.
fit_measures()
Prints fit measures for the Lgc object.
Lgc$fit_measures(print = F, ...)
anova()
Prints hypothesis tests for the Lgc object.
Lgc$anova(print = F, detailed = F, ...)
compare()
Compares the lavaan objects contained in Lgc objects.
Lgc$compare(...)
...
Additional arguments passed down to anova(lavaan_object, ...).
get_data()
Returns the data tibble.
Lgc$get_data()
set_data()
Sets the data tibble.
Lgc$set_data(data)
data
tibble.
power_analysis()
Plots a directed acyclic graph for the Lgc object.
Lgc$power_analysis(data_syntax, sample_size = 100L, replications = 500L, ...)
data_syntax
List of characters. Each character represents syntax to simulate data for a separate group.
sample_size
Vector of integers. Must be of length or the same length as data_syntax.
replications
Integer. Number of replications.
...
Additional arguments.
reliabilities()
Lgc$reliabilities()
clone()
The objects of this class are cloneable with this method.
Lgc$clone(deep = FALSE)
deep
Whether to make a deep clone.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.