data("hardlyworking")
m <- lm(salary ~ factor(n_comps) + xtra_hours * seniority, data = hardlyworking)
r2_semipartial(m)
r2_semipartial(m, type = "parameters")
# Compare to `eta_squared()`
# --------------------------
npk.aov <- lm(yield ~ N + P + K, npk)
# When predictors are orthogonal,
# eta_squared(partial = FALSE) gives the same effect size:
performance::check_collinearity(npk.aov)
eta_squared(npk.aov, partial = FALSE)
r2_semipartial(npk.aov)
if (FALSE) { # interactive()
# Compare to `dominance_analysis()`
# ---------------------------------
m_full <- lm(salary ~ ., data = hardlyworking)
r2_semipartial(m_full)
# Compare to last column of "Conditional Dominance Statistics":
parameters::dominance_analysis(m_full)
}
Run the code above in your browser using DataLab