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

An object of type fit_stats 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)
#> Type of Statistic: fit_stats
#> 
#>   ID      AIC
#> 1  1 -804.341
#> 2  2 -750.480
#> 3  3 -926.449
#> 
#> (access the data.frame's columns/rows as usual)

# BICs
BIC(all_fits)
#> Type of Statistic: fit_stats
#> 
#>   ID      BIC
#> 1  1 -777.621
#> 2  2 -723.802
#> 3  3 -899.729
#> 
#> (access the data.frame's columns/rows as usual)

# Log-Likelihoods
logLik(all_fits)
#> Type of Statistic: fit_stats
#> 
#>   ID Log_Like
#> 1  1  409.170
#> 2  2  382.240
#> 3  3  470.224
#> 
#> (access the data.frame's columns/rows as usual)

# All unique and free parameters
coef(all_fits)
#> Object Type: coefs_dm
#> 
#>   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
#> 
#> (access the data.frame's columns/rows as usual)

# Or all parameters across all conditions
coef(all_fits, select_unique = FALSE)
#> Object Type: coefs_dm
#> 
#>   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
#> 
#> (access the data.frame's columns/rows as usual)