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")
#> Warning: lavaan->lav_object_post_check():  
#>    some estimated ov variances are negative
get_uni_bi_moments(fit)
#> $pdot1
#> [1] 0.920 0.712 0.562 0.786 0.860
#> 
#> $pidot1
#> [1] 0.9199913 0.7120347 0.5620351 0.7859767 0.8599871
#> 
#> $pdot2
#>  [1] 0.696 0.536 0.742 0.810 0.436 0.582 0.630 0.450 0.498 0.686
#> 
#> $pidot2
#>  [1] 0.6960956 0.5380370 0.7406908 0.8090064 0.4307265 0.5823818 0.6335411
#>  [8] 0.4551140 0.4955261 0.6850943
#>