print.lav_betaselect: Print a 'lav_betaselect' Object

View source: R/print_std_selected_lavaan.R

print.lav_betaselectR Documentation

Print a 'lav_betaselect' Object

Description

Print method for a 'lav_betaselect' object, which is the output of lav_betaselect().

Usage

## S3 method for class 'lav_betaselect'
print(
  x,
  ...,
  nd = 3,
  output = c("lavaan.printer", "table"),
  standardized_only = TRUE,
  show_Bs.by = FALSE,
  by_group = TRUE,
  na_str = " ",
  sig_stars = TRUE,
  ci_sig = TRUE
)

Arguments

x

A lav_betaselect-class object, such as the output of lav_betaselect().

...

Optional arguments to be passed to print() methods.

nd

The number of digits after the decimal place. Default is 3.

output

String. How the results are printed. Default is "lavaan.printer", and the results will be printed in a format similar to the printout of the output of the summary-method of a 'lavaan'-class object. If set to "table", the results are printed in a table format similar to that of lavaan::parameterEstimates() with output set to "data.frame".

standardized_only

Logical. If TRUE, the default, only the results for the standardized solution will be printed. If FALSE, then the standardized solution is printed alongside the unstandardized solution, as in the printout of the output of summary() of a 'lavaan'-class object.

show_Bs.by

Logical. If TRUE and output is "lavaan.printer", then the column "Bs.by" is shown, indicating, for each parameter, the variables standardized. This column is not shown if output is not "lavaan.printer".

by_group

If TRUE, the default, and the model has more than one group, sections will be grouped by groups first, as in the print out of summary() in lavaan. If FALSE, then the sections will be grouped by sections first.

na_str

The string to be used for cells with NA. Default is " ", a whitespace.

sig_stars

If TRUE, the default, symbols such as asterisks (*, ⁠**⁠, ⁠***⁠) will be used to denote whether a beta-select is significant.

ci_sig

If TRUE, the default, a beta-select will be denoted as significant or not significant based on its confidence interval.

Details

The default format of the printout, "lavaan.printer", is similar to that of the summary() of a lavaan object. Users can also select whether only the standardized solution is printed or whether the standardized solution is appended to the right of the printout.

If output is set to ⁠"table"' the format is that of [lavaan::parameterEstimates()] with ⁠output = "data.frame"', which is compact but not easy to read.

Value

x is returned invisibly. Called for its side effect.

Author(s)

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

See Also

lav_betaselect(). This function is adapted from semhelpinghands::print.std_solution_boot().

Examples

library(lavaan)
mod <-
"
med ~ iv + mod + iv:mod
dv ~ med + iv
"
fit <- sem(mod,
           data_test_medmod,
           fixed.x = TRUE)
summary(fit)
fit_beta <- lav_betaselect(fit,
                           to_standardize = c("iv", "dv"))
fit_beta
print(fit_beta)
print(fit_beta, show_Bs.by = TRUE)
print(fit_beta, output = "table")


betaselectr documentation built on April 3, 2025, 8:51 p.m.