print.semlbci: Print Method of a 'semlbci' Object

View source: R/print_semlbci.R

print.semlbciR Documentation

Print Method of a 'semlbci' Object

Description

Prints the results of a semlbci object, the output of semlbci().

Usage

## S3 method for class 'semlbci'
print(
  x,
  digits = 3,
  annotation = TRUE,
  time = FALSE,
  verbose = FALSE,
  verbose_if_needed = TRUE,
  drop_no_lbci = TRUE,
  output = c("table", "text", "lavaan"),
  sem_out = NULL,
  lbci_only = drop_no_lbci,
  ratio_digits = 1,
  se = TRUE,
  zstat = TRUE,
  pvalue = TRUE,
  boot.ci.type = "perc",
  ...
)

Arguments

x

The output of semlbci().

digits

The number of digits after the decimal point. To be passed to formatC(). Default is 3.

annotation

If TRUE, print table notes. Default is TRUE.

time

If TRUE, print the time spent on each bound. Default is FALSE.

verbose

If TRUE, additional diagnostic information will always be printed. This argument overrides verbose_if_needed. Default is FALSE.

verbose_if_needed

If TRUE, additional diagnostic information will be printed only if necessary. If FALSE, additional diagnostic information will always be printed. Default is TRUE.

drop_no_lbci

If TRUE, parameters without LBCIs will be removed. Default is TRUE.

output

The type of printout. If "table", the default, the results will be printed in a table. If "text" or "lavaan", then the results will be printed in the lavaan style, as in the summary() method for the output of lavaan.

sem_out

If output is "text" or "lavaan", the original output of lavaan used in calling semlbci() needs to be supplied to this argument.

lbci_only

Used only if output is "text" or "lavaan". If TRUE, only the likelihood-based confidence intervals (LBCIs) will be printed. If FALSE, and LBCIs will be printed alongside the confidence intervals by lavaan. Its default value depend on the argument drop_no_lbci. If drop_no_lbci is TRUE, then lbci_only is TRUE by default. If drop_no_lbci is FALSE, then lbci_only is FALSE by default.

ratio_digits

The number of digits after the decimal points for the ratios of distance from the confidence limits to the point estimates. Default is 1.

se

Logical. To be passed to lavaan::parameterEstimates(). Whether standard error (S.E.) will be printed. Only applicable if output is "text" or "lavaan".

zstat

Logical. To be passed to lavaan::parameterEstimates(). Whether z-values will be printed. Only applicable if output is "text" or "lavaan".

pvalue

Logical. To be passed to lavaan::parameterEstimates(). Whether p-values will be printed. Only applicable if output is "text" or "lavaan".

boot.ci.type

Logical. To be passed to lavaan::parameterEstimates(). The type of bootstrap confidence intervals to be printed if bootstrapping confidence intervals available. Possible values are "norm", "basic", "perc", or "bca.simple". The default value is "perc". Refer to the help of lavaan::parameterEstimates() for further information. Only applicable if output is "text" or "lavaan".

...

Other arguments. They will be ignored.

Details

Prints the results of semlbci() as a table.

Value

x is returned invisibly. Called for its side effect.

Author(s)

Shu Fai Cheung https://orcid.org/0000-0002-9871-9448

See Also

semlbci()

Examples


library(lavaan)
mod <-
"
m ~ a*x
y ~ b*m
ab := a * b
"
fit_med <- sem(mod, simple_med, fixed.x = FALSE)
p_table <- parameterTable(fit_med)
p_table
lbci_med <- semlbci(fit_med,
                    pars = c("ab :="))
lbci_med

print(lbci_med, verbose_if_needed = FALSE)

print(lbci_med, verbose = TRUE)

print(lbci_med, time = TRUE)

print(lbci_med, annotation = FALSE)

print(lbci_med, digits = 4)

# Text output

print(lbci_med, output = "lavaan", sem_out = fit_med)

print(lbci_med, output = "lavaan", sem_out = fit_med, lbci_only = FALSE)

print(lbci_med, output = "lavaan", sem_out = fit_med, lbci_only = FALSE,
      se = FALSE, zstat = FALSE, pvalue = FALSE)


semlbci documentation built on June 22, 2024, 10:55 a.m.