Skip to content

Commit

Permalink
remove BF
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Feb 16, 2024
1 parent e6346e3 commit bc9d235
Showing 1 changed file with 1 addition and 25 deletions.
26 changes: 1 addition & 25 deletions vignettes/r2.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,11 @@ knitr::opts_chunk$set(
)
options(digits = 2)
pkgs <- c(
"effectsize", "BayesFactor", "lme4", "rstanarm"
)
pkgs <- c("effectsize", "lme4", "rstanarm")
successfully_loaded <- sapply(pkgs, requireNamespace, quietly = TRUE)
if (all(successfully_loaded)) {
library(performance)
library(effectsize)
library(BayesFactor)
library(lme4)
library(rstanarm)
}
Expand Down Expand Up @@ -147,27 +144,6 @@ model <- stan_lmer(Petal.Length ~ Petal.Width + (1 | Species), data = iris, refr
r2(model)
```

Let's look at another regression analysis carried out with `{BayesFactor}` package.

```{r, eval=successfully_loaded["BayesFactor"] && utils::packageVersion("BayesFactor") >= package_version("0.9.12-4.3")}
library(BayesFactor)
data(puzzles)
m1 <- anovaBF(extra ~ group + ID,
data = sleep,
whichRandom = "ID", progress = FALSE
)
r2(m1)
m2 <- generalTestBF(RT ~ shape * color + ID,
data = puzzles, whichRandom = "ID",
neverExclude = "ID", progress = FALSE
)
r2(m2)
```

# Comparing change in R2 using Cohen's *f*

Cohen's $f$ (of [ANOVA fame](https://easystats.github.io/effectsize/articles/anovaES.html)) can be used as a measure of effect size in the context of sequential multiple regression (i.e., [**nested models**](https://easystats.github.io/performance/reference/test_performance.html)).
Expand Down

0 comments on commit bc9d235

Please sign in to comment.