print.est_change {semfindr}R Documentation

Print an 'est_change' Class Object

Description

Print the content of an 'est_change'-class object.

Usage

## S3 method for class 'est_change'
print(x, digits = 3, first = 10, sort_by = c("gcd", "est"), ...)

Arguments

x

An 'est_change'-class object.

digits

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

first

Numeric. If not NULL, it prints only the first k cases, k equal to first. Default is 10.

sort_by

String. Should be "est", "gcd", or NULL. If the output was generated by est_change_raw() or est_change_raw_approx() and sort_by is not NULL, then each column is sorted individually, with case IDs inserted before each column. If the output was generated by est_change() or est_change_approx() and sort_by is not NULL, then sort_by determines how the cases are sorted. If by is "est", the cases are sorted as for the output of est_change_raw(). If by is "gcd", the default for the output of est_change() or est_change_approx(), then cases are sorted by generalized Cook's distance or approximate generalized Cook's distance, depending on which column is available.

...

Other arguments. They will be ignored.

Details

All the functions on case influence on parameter estimates, est_change(), est_change_approx(), est_change_raw(), and est_change_raw_approx(), return an est_change-class object. This method will print the output based on the type of changes and method used.

Value

x is returned invisibly. Called for its side effect.

See Also

est_change_raw(), est_change_raw_approx(), est_change(), est_change_approx()

Examples


library(lavaan)

# A path model

dat <- pa_dat
mod <-
"
m1 ~ a1 * iv1 + a2 * iv2
dv ~ b * m1
a1b := a1 * b
a2b := a2 * b
"
# Fit the model
fit <- lavaan::sem(mod, dat)
summary(fit)

# Approximate case influence
out <- est_change_approx(fit)
out
print(out, sort_by = "est")
out <- est_change_raw_approx(fit)
print(out, first = 3)

# Examine four selected cases
fit_rerun <- lavaan_rerun(fit, parallel = FALSE,
                          to_rerun = c(2, 3, 5, 7))
est_change(fit_rerun)
est_change_raw(fit_rerun)


[Package semfindr version 0.1.8 Index]