Skip to contents

These methods are wrappers to extract specific model fit statistics (log-likelihood, AIC, BIC) for each model in a fits_ids_dm object.

Usage

# S3 method for class 'fits_ids_dm'
logLik(object, ...)

# S3 method for class 'fits_ids_dm'
AIC(object, ..., k = 2)

# S3 method for class 'fits_ids_dm'
BIC(object, ...)

Arguments

object

a fits_ids_dm object (see estimate_model_ids)

...

additional arguments

k

numeric; penalty parameter for the AIC calculation. Defaults to 2 (standard AIC).

Value

A data.frame containing the respective statistic in one column (named Log_Like, AIC, or BIC) and a corresponding ID column.

Details

Each function retrieves the relevant statistics by calling calc_stats with type = "fit_stats" and selects the columns for ID and the required statistic.

Examples

# get an auxiliary fits_ids object for demonstration purpose;
# such an object results from calling load_fits_ids
all_fits <- get_example_fits_ids()

# AICs
AIC(all_fits)
#>   ID       AIC
#> 1  1 -804.3384
#> 2  2 -750.5240
#> 3  3 -926.4580

# BICs
BIC(all_fits)
#>   ID       BIC
#> 1  1 -777.6187
#> 2  2 -723.8460
#> 3  3 -899.7382

# Log-Likelihoods
logLik(all_fits)
#>   ID Log_Like
#> 1  1 409.1692
#> 2  2 382.2620
#> 3  3 470.2290

# All unique and free parameters
coef(all_fits)
#>   ID muc    b non_dec sd_non_dec  tau    A alpha
#> 1  1 4.7 0.44    0.34       0.03 0.04 0.10   7.0
#> 2  2 5.4 0.40    0.30       0.04 0.05 0.09   3.0
#> 3  3 5.8 0.60    0.32       0.01 0.11 0.19   3.7

# Or all parameters across all conditions
coef(all_fits, select_unique = FALSE)
#>   ID   Cond muc    b non_dec sd_non_dec  tau a     A alpha peak_l
#> 1  1   comp 4.7 0.44    0.34       0.03 0.04 2  0.10   7.0   0.04
#> 2  1 incomp 4.7 0.44    0.34       0.03 0.04 2 -0.10   7.0   0.04
#> 3  2   comp 5.4 0.40    0.30       0.04 0.05 2  0.09   3.0   0.05
#> 4  2 incomp 5.4 0.40    0.30       0.04 0.05 2 -0.09   3.0   0.05
#> 5  3   comp 5.8 0.60    0.32       0.01 0.11 2  0.19   3.7   0.11
#> 6  3 incomp 5.8 0.60    0.32       0.01 0.11 2 -0.19   3.7   0.11