Skip to contents

print() shows a compact summary of the data simulated by efa_simulate(): how many datasets were drawn and their dimensions, the marginal distribution, whether the data were discretized into ordered categories or given missing values, and – when model error was injected – the method with the target and achieved RMSEA and CFI. The simulated data themselves live in the data element and the population correlation matrix in population. format() returns the same summary as a character vector; print() is cat(format(x), sep = "\n"). The lines follow the active console theme, so they are plain when colours are disabled.

Usage

# S3 method for class 'efa_simulated'
print(x, digits = 3, ...)

# S3 method for class 'efa_simulated'
format(x, digits = 3, ...)

Arguments

x

An object of class efa_simulated (output from efa_simulate()).

digits

Integer. The number of decimal places the reported fit values are rounded to. Default is 3.

...

Not used; for consistency with the generic.

Value

print() returns its argument x invisibly. format() returns a character vector with the summary lines (styled to the active console theme; plain when colours are disabled).

See also

Other data simulation: efa_simulate()

Examples

Lambda <- population_models$loadings$baseline
Phi <- population_models$phis_3$moderate
efa_simulate(N = 500, Lambda = Lambda, Phi = Phi, target_rmsea = 0.05, seed = 42)
#> Simulated data (<efa_simulated>)
#> 
#> 500 cases by 18 variables (continuous).
#> Marginals: normal.
#> 
#> Model error: CB
#> RMSEA: target .050, achieved .050
#> CFI: target --, achieved .936