Skip to contents

Compare idiographic fits

Usage

compare(...)

Arguments

...

One or more consolidated idiographic fits (from fit_lm(), fit_glm(), fit_ml(), fit_subgroups() or fit_rolling()).

Value

A data.frame with one row per fit, scope and model: fit (the position of the fit in ...), method, and the .overall columns of metrics(). An empty data.frame when no fit is supplied.

Examples

linear <- fit_lm(srl, y = "effort", x = "efficacy", id = "name",
                 time = "day")
ridge <- fit_ml(srl, y = "effort", x = "efficacy", id = "name",
                time = "day", model = "ridge")
compare(linear, ridge)
#>   fit method      scope model estimator  subject subgroup    n     rmse
#> 1   1     lm     pooled    lm    native .overall     .all 1150 22.15170
#> 2   1     lm individual    lm    native .overall     .all 1150 19.22193
#> 3   2     ml     pooled ridge    native .overall     .all 1150 22.15203
#> 4   2     ml individual ridge    native .overall     .all 1150 19.22689
#>        mae      bias r_squared
#> 1 18.16606 0.5861259 0.3200665
#> 2 14.95209 0.4451146 0.4880281
#> 3 18.16660 0.5862116 0.3200465
#> 4 14.96088 0.4489865 0.4877635