Skip to contents

This function generates a publication table from a list of lavaan models to be exported or copy-pasted (e.g. into Excel). The table shows all parameters with operator "~" (i.e. regression paths) with significance level:

  • ***p < .001

  • **p < .01

  • *p < .05

  • +p < .10

Each column is a different outcome variable/lavaan model, each row is a different predictor.

Usage

make_pub_table_from_lavaan_models(
  ana,
  check_same_format = TRUE,
  transpose = FALSE
)

Arguments

ana

list of lavaan models

check_same_format

(logical) whether to force all models to have the same predictors

transpose

(logical) whether to transpose the table (default FALSE)

Value

data.frame with predictors and coefficients (and significance level) in each model

Examples

library(lavaan)
ana <- list()
ana$y1 <- sem("y1 ~ x1+x2", df)
ana$y2 <- sem("y2 ~ x1+x2", df)
ana |> make_pub_table_from_lavaan_models()
#>   Predictor      y1      y2
#> 1        x1 0.58*** 0.25***
#> 2        x2 0.17*** 0.72***