# suppress the warnings and other messages from showing in the knitted file.
knitr::opts_chunk$set(fig.width = 7, fig.height = 5, fig.path = "figures/", echo = TRUE, warning = FALSE, message = FALSE)
devtools::source_gist("8e6e5dc401e3fc1042ef7a030f9d19c7", filename = "revised_toc.R")
if (!require(easiOrigin)) {
  if (!require(remotes)) install.packages("remotes")
  remotes::install_github("cwendorf/easiOrigin")
}
library(easiOrigin)

Factorial Vignette

This vignette analyzes data from a two-factor between-subjects design.

thisfile <- knitr::current_input()
revised_toc(thisfile, base_level = 3, toc_depth = 4)

Data Management

Data Entry

FactorA <- c(1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2)
FactorB <- c(1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2)
Outcome <- c(0, 0, 3, 5, 4, 7, 4, 9, 9, 6, 4, 9, 3, 6, 8, 3)
FactorA <- factor(FactorA, levels = c(1, 2), labels = c("A1", "A2"))
FactorB <- factor(FactorB, levels = c(1, 2), labels = c("B1", "B2"))
FactorialData <- data.frame(FactorA, FactorB, Outcome)
FactorialData

Descriptive Statistics

descMeansBy(Outcome ~ FactorA, by = FactorB)

Analyses of the Means

Confidence Intervals

ciMeansBy(Outcome ~ FactorA, by = FactorB)
ciMeansBy(Outcome ~ FactorA, by = FactorB, conf.level = .99)

Significance Tests

nhstMeansBy(Outcome ~ FactorA, by = FactorB)
nhstMeansBy(Outcome ~ FactorA, by = FactorB, mu = 5)

Analyses of the Effects

Source Table

descMultifactor(Outcome ~ FactorA, by = FactorB)

Significance Test

nhstMultifactor(Outcome ~ FactorA, by = FactorB)

Effect Size

pvaMultifactor(Outcome ~ FactorA, by = FactorB)


cwendorf/easiOrigin documentation built on Nov. 1, 2023, 10:57 a.m.