print.sbt_std_boot {semboottools}R Documentation

Print a 'sbt_std_boot' Object

Description

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

Usage

## S3 method for class 'sbt_std_boot'
print(
  x,
  ...,
  nd = 3,
  output = c("lavaan.printer", "text", "table"),
  standardized_only = TRUE,
  boot_ci_only = FALSE,
  drop_cols = "Z"
)

Arguments

x

Object of the class sbt_std_boot, the output of standardizedSolution_boot().

...

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. If set to "table", the results are printed in a table format similar to that of lavaan::standardizedSolution(). If set to "text", the results will be printed in a text format similar to the printout of the output of summary() of a 'lavaan'-class object. If set to "lavaan.printer", the default, lavaan.printer will be used to print a more compact version of the "text" output.

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.

boot_ci_only

Logical. Whether only bootstrap confidence intervals are printed. If FALSE, the default, the delta method confidence intervals by lavaan::standardizedSolution() are also printed.

drop_cols

The name(s) of the column(s) to drop if output format is "lavaan.printer". Default is "Z", to fit the print out to the usual screen width of 80.

Details

The default format of the printout, "lavaan.printer", is a compact version of the lavaan-style printout, generated by lavaan.printer. Alternatively, users can request a format similar to that of the printout of the summary of a lavaan output by setting output to "text". This format can be used if "lavaan.printer" failed.

Users can also print the content just as a data frame by setting output to "table". Not easy to read much more compact.

For the "text" or "lavaan.printer" format, users can also select whether only the standardized solution is printed (the default) or whether the standardized solution is appended to the right of the printout.

Value

x is returned invisibly. Called for its side effect.

Author(s)

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

See Also

standardizedSolution_boot()

Examples

library(lavaan)
set.seed(5478374)
n <- 50
x <- runif(n) - .5
m <- .40 * x + rnorm(n, 0, sqrt(1 - .40))
y <- .30 * m + rnorm(n, 0, sqrt(1 - .30))
dat <- data.frame(x = x, y = y, m = m)
model <-
'
m ~ a*x
y ~ b*m
ab := a*b
'

# Should set bootstrap to at least 2000 in real studies
fit <- sem(model, data = dat, fixed.x = FALSE,
           se = "boot",
           bootstrap = 50)
std_out <- standardizedSolution_boot(fit)
std_out
print(std_out, standardized_only = FALSE)


[Package semboottools version 0.1.0 Index]