SfL provides small teaching-oriented helpers while leaving model fitting and specialised inference to established R packages.

Descriptive helpers

mode_stat(c(1, 1, 2, 3))
#> [1] 1
se(c(1, 2, 3, 4))
#> [1] 0.6454972

data("data_s")
create_error_bar_df(data_s, "sDur", "pauseBin", type = "std")
#>   pauseBin      sDur         std
#> 1 no_pause 0.1095498 0.003569137
#> 2    pause 0.1654329 0.008188571

Correlations

corfun(data_s, c("sDur", "sDurLog", "speakingRate"))
#>                sDur sDurLog speakingRate
#> sDur                                    
#> sDurLog       1.000                     
#> speakingRate -0.237  -0.237

correlation_matrix() creates a base-R pairs plot with correlation coefficients, histograms, and optional smoothers.

Mixed-model R-squared

SfL 1.0.0 calculates marginal and conditional R-squared values for Gaussian lme4::lmer() models without requiring MuMIn.

model <- lme4::lmer(Reaction ~ Days + (Days | Subject), lme4::sleepstudy)
mixed_model_r2(model)
#>         R2m       R2c
#> 1 0.2786511 0.7992199

Workshop resources

Slides and exercises are hosted on GitHub Pages. These examples are not run while building the vignette because they open a web browser.

open_slide(3, 2021, "english")
open_exercise(3, 2026, "marburg")

Optional plotting packages