Skip to contents

This functions extracts a tibble reporting the parameters fits for the input model (clusters, means of clusters, dispersion, likelihood score, cluster sizes etc.).

Usage

to_string(x)

Arguments

x

An object of class bmix that represents a fit.

Value

A `tibble` for the statistcis.

Examples

# The same dataset used in the package vignette
data = data.frame(successes = c(rbinom(30, 100, .4), rbinom(70, 100, .7)), trials = 100)

# BMix fit with default parameters
x = bmixfit(data)
#> 
#> ── BMix fit ────────────────────────────────────────────────────────────────────
#> 
#> ℹ Binomials k_B = 1 and 2, Beta-Binomials k_BB = 0; 4 fits to run.
#> 
#> ℹ Bmix best fit completed in 0 mins
#> 
#> ── [ BMix ] My BMix model n = 100 with k = 2 component(s) (2 + 0) ──────────────
#> • Clusters: π = 70% [Bin 2] and 30% [Bin 1], with π > 0.
#> • Binomial Bin 1 with mean = 0.400666088563357.
#> • Binomial Bin 2 with mean = 0.701854103880702.
#> ℹ Score (model selection): ICL = 711.69.

to_string(x)
#> # A tibble: 1 × 15
#>       N N_Bin_1 N_Bin_2   K_B  K_BB     K Pi_Bin_1 Pi_Bin_2   NLL   ICL   BIC
#>   <int>   <int>   <int> <dbl> <dbl> <dbl>    <dbl>    <dbl> <dbl> <dbl> <dbl>
#> 1   100      30      70     2     0     2    0.300    0.700  347.  712.  712.
#> # ℹ 4 more variables: entropy <dbl>, score <chr>, Mean_Bin_1 <dbl>,
#> #   Mean_Bin_2 <dbl>