lgc: Prints the reliabilities of the indicators of latent...

View source: R/lgc.R

LgcR Documentation

Prints the reliabilities of the indicators of latent variables.

Description

Some description

Usage

lgc(...)

lgc_dummy(...)

Details

Lgc Class

lgc() is a wrapper for the R6 class constructor Lgc$new(). See Lgc$new() below for a list of arguments.

Active bindings

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.

Methods

Public methods


Method new()

Prints coefficients for the Lgc object.

Lgc class constructor.

Usage
Lgc$new()

Method get_facet_grid()

Usage
Lgc$get_facet_grid()

Method has_latent_dv()

Usage
Lgc$has_latent_dv()

Method has_latent_covariate()

Usage
Lgc$has_latent_covariate()

Method has_covariate()

Usage
Lgc$has_covariate()

Method has_within()

Usage
Lgc$has_within()

Method has_resid_cov()

Usage
Lgc$has_resid_cov()

Method get_labels()

Usage
Lgc$get_labels(
  labels,
  parse_action = c("underscore", "empty", "remove"),
  format = c("plotmath", "text", "syntax"),
  sep = ","
)

Method is_indicator()

Usage
Lgc$is_indicator(variables)

Method belongs_to()

Usage
Lgc$belongs_to(variables, whom)

Method get_etas_mmodel()

Usage
Lgc$get_etas_mmodel()

Method get_covariates_mmodel()

Usage
Lgc$get_covariates_mmodel()

Method is_latent()

Usage
Lgc$is_latent(variables)

Method specify()

Specifies an Lgc object.

Usage
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,
  ...
)
Arguments
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.


Method specify_dummy()

Usage
Lgc$specify_dummy(
  n_etas = 1,
  n_indicators_eta = 1,
  n_groups = 1,
  c_matrix_within = NULL,
  n_covariates = NULL,
  hypotheses = NULL,
  ...
)

Method estimate()

Estimates the model.

Usage
Lgc$estimate(...)
Arguments
...

Additional arguments.


Method get_lav_syntax()

Retrieves the lavaan syntax.

Usage
Lgc$get_lav_syntax(...)
Arguments
...

Additional arguments.


Method get_estimates()

Returns the point estimates of the model.

Usage
Lgc$get_estimates(
  what = c("variance", "covariance", "intercept", "measurement", "resid_var",
    "resid_cov", "regression"),
  only_unique_labels = FALSE,
  ...
)
Arguments
what

Character vector.

only_unique_labels

Logical. Default is FALSE.

...

Additional arguments.


Method test()

Tests the provided hypothesis on the lgc object.

Usage
Lgc$test(hypothesis)
Arguments
hypothesis

Object of class Hypothesis.


Method tests_table()

Tests multiple hypotheses on the lgc object and returns the results as a table.

Usage
Lgc$tests_table(hypotheses)
Arguments
hypothesis

List of objects of class Hypothesis.


Method print()

Prints the lavaan object.

Usage
Lgc$print(...)

Method summary()

Prints a summary for the Lgc object.

Usage
Lgc$summary(fit_measures = T, anova = T, coefficients = T, ...)
Arguments
fit_measures

Logical. Indicates whether fit measures should be printed.

detailed

Logical. Indicates whether a detailed summary should be printed.


Method fit_measures()

Prints fit measures for the Lgc object.

Usage
Lgc$fit_measures(print = F, ...)

Method anova()

Prints hypothesis tests for the Lgc object.

Usage
Lgc$anova(print = F, detailed = F, ...)

Method compare()

Compares the lavaan objects contained in Lgc objects.

Usage
Lgc$compare(...)
Arguments
...

Additional arguments passed down to anova(lavaan_object, ...).


Method get_data()

Returns the data tibble.

Usage
Lgc$get_data()

Method set_data()

Sets the data tibble.

Usage
Lgc$set_data(data)
Arguments
data

tibble.


Method power_analysis()

Plots a directed acyclic graph for the Lgc object.

Usage
Lgc$power_analysis(data_syntax, sample_size = 100L, replications = 500L, ...)
Arguments
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.


Method reliabilities()

Usage
Lgc$reliabilities()

Method clone()

The objects of this class are cloneable with this method.

Usage
Lgc$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


langenberg/semnova documentation built on Feb. 12, 2025, 7:06 a.m.