tidy_stats.mixed: Create a tidy stats data frame from an afex mixed object

Description Usage Arguments Examples

View source: R/tidy_stats.mixed.R

Description

tidy_stats.mixed takes an afex mixed object and converts the object to a tidy stats data frame.

Usage

1
2
## S3 method for class 'mixed'
tidy_stats(model, args = NULL)

Arguments

model

Output of afex's mixed.

args

Unused.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
# Check if afex package is available
if(!requireNamespace("afex", quietly = TRUE)) {

  message(paste0("Package 'afex' is needed for this example to work. ",
                 "Please install it."), .call = FALSE)
} else {

  # Load data
  data("sk2011.2", package = "afex")
  sk2_aff <- droplevels(sk2011.2[sk2011.2$what == "affirmation",])

  # Perform the analysis
  sk_m1 <- afex::mixed(response ~ instruction * inference * type +
                       (inference * type | id), sk2_aff)

  # Tidy stats
  tidy_stats(sk_m1) # Default ANOVA output
  tidy_stats(sk_m1, args = list(summary = "lmer")) # lmer summary
}

WillemSleegers/tidystats-v0.3 documentation built on Aug. 12, 2019, 5:31 p.m.