Skip to contents

This function prints to console which effects are significant in table1 but not in table2, and which are significant in table2 but not in table1. The two tables are publication tables generated by any of the make_pub_table_from_...() functions

Usage

compare_sig_effects_in_two_pub_tables(table1, table2, pattern = "*", fixed = T)

Arguments

table1

A publication table

table2

Another publication table

pattern

Pattern used to determine significant effects (default is *)

fixed

(logical) Whether pattern is to be searched as is (TRUE) or as a regular expression (FALSE)

Examples

library(lavaan)
#> This is lavaan 0.6-12
#> lavaan is FREE software! Please report any bugs.
ana <- list()
ana$y1 <- sem("y1 ~ x1+x2", df, missing="ml.x")
ana$y2 <- sem("y2 ~ x1+x2", df, missing="ml.x")
pub_sem <- ana |> make_pub_table_from_lavaan_models()

library(broom)
ana <- list()
ana$y1 <- lm(y1 ~ x1+x2, df) |> tidy()
ana$y2 <- lm(y2 ~ x1+x2, df) |> tidy()
pub_lm <- ana |> make_pub_table_from_broom_tidy()

# sensitivity analysis: effect of missing data
pub_lm |> compare_sig_effects_in_two_pub_tables(pub_sem)
#> _______________________________
#> * in table1 but not in table2:
#> character(0)
#> _______________________________
#> * in table2 but not in table1:
#> character(0)