Skip to contents

Returns univariate and bivariate moments (i.e. positive probabilities only) based on model i.e. pidot1 and pidot2 and (weighted) sample i.e. pdot1 and pdot2.

Usage

get_uni_bi_moments(.lavobject, wtd = TRUE)

Arguments

.lavobject

A lavaan::lavaan() fit object.

wtd

(logical) Should the weighted proportions be used?

Value

A list of univariate and bivariate moments.

Examples

fit <- lavaan::sem(txt_mod(1), gen_data_bin(1, n = 500), std.lv = TRUE,
                   estimator = "PML")
get_uni_bi_moments(fit)
#> $pdot1
#> [1] 0.920 0.698 0.564 0.778 0.892
#> 
#> $pidot1
#> [1] 0.9200287 0.6980239 0.5638846 0.7780402 0.8920130
#> 
#> $pdot2
#>  [1] 0.684 0.548 0.744 0.826 0.434 0.588 0.648 0.470 0.502 0.704
#> 
#> $pidot2
#>  [1] 0.6845333 0.5436145 0.7448265 0.8298315 0.4390339 0.5882584 0.6368762
#>  [8] 0.4677908 0.5123317 0.7032736
#>