Learn R Programming

groupedstats (version 0.1.0)

lm_effsize_ci: Confidence intervals for (partial) eta-squared and omega-squared for linear models.

Description

This function will convert a linear model object to a dataframe containing statistical details for all effects along with effect size measure and its confidence interval. For more details, see parameters::eta_squared and parameters::omega_squared.

Usage

lm_effsize_ci(
  object,
  effsize = "eta",
  partial = TRUE,
  conf.level = 0.95,
  nboot = 500,
  method = c("dist", "quantile"),
  ...
)

Arguments

object

The linear model object (can be of class lm, aov, anova, or aovlist).

effsize

Character describing the effect size to be displayed: "eta" (default) or "omega".

partial

Logical that decides if partial eta-squared or omega-squared are returned (Default: TRUE). If FALSE, eta-squared or omega-squared will be returned. Valid only for objects of class lm, aov, anova, or aovlist.

conf.level

Numeric specifying Level of confidence for the confidence interval (Default: 0.95).

nboot

Number of bootstrap samples for confidence intervals for partial eta-squared and omega-squared (Default: 500).

method

Character vector, indicating if confidence intervals should be based on bootstrap standard error, multiplied by the value of the quantile function of the t-distribution (default), or on sample quantiles of the bootstrapped values. See 'Details' in boot_ci(). May be abbreviated.

...

Currently ignored.

Value

A dataframe with results from stats::lm() with partial eta-squared, omega-squared, and bootstrapped confidence interval for the same.

Examples

Run this code
# NOT RUN {
# for reproducibility
set.seed(123)

# model
mod <-
  stats::aov(
    formula = mpg ~ wt + qsec + Error(disp / am),
    data = mtcars
  )

# dataframe with effect size and confidence intervals
groupedstats::lm_effsize_ci(mod)
# }

Run the code above in your browser using DataLab