This calculator helps you analyze the effects of three independent variables (factors) on a dependent variable. It calculates main effects and interaction effects between factors, helping you understand how multiple categorical variables influence your outcome measure. It checks assumptions, provides a detailed ANOVA table, and an APA-style report. for a quick example.
Where:
Test statistic for each factor:
Investigating the effects of teaching method, gender, and grade level on test scores:
| Teaching Method | Gender | Grade | Test Scores |
|---|---|---|---|
| Lecture | Male | 9th | 98 |
| Lecture | Male | 9th | 84 |
| Lecture | Male | 10th | 98 |
| GroupWork | Male | 9th | 72 |
| GroupWork | Male | 10th | 72 |
| ... | |||
For the complete dataset, please refer to the code examples below.
Main Effects:
Interactions:
| Source | SS | df | MS | F | p-value |
|---|---|---|---|---|---|
| Method | 68 | 2 | 34.22 | 0.403 | 0.671 |
| Gender | 180 | 1 | 180.27 | 2.123 | 0.152 |
| Grade | 38 | 1 | 38.40 | 0.452 | 0.504 |
| Method:Gender | 66 | 2 | 32.92 | 0.388 | 0.681 |
| Method:Grade | 218 | 2 | 108.95 | 1.283 | 0.286 |
| Gender:Grade | 4 | 1 | 4.27 | 0.050 | 0.824 |
| Method:Gender:Grade | 137 | 2 | 68.52 | 0.807 | 0.452 |
| Residuals | 4076 | 48 | 84.91 |
library(tidyverse)
set.seed(42)
# Data preparation
data <- tibble(
Method = rep(c("Lecture", "GroupWork", "Mixed"), each = 20),
Gender = rep(rep(c("Male", "Female"), each = 10), 3),
Grade = rep(c("9th", "10th"), each = 5, times = 6),
Score = round(runif(60, min = 70, max = 100))
)
# Run 3-way ANOVA
model <- aov(Score ~ Method * Gender * Grade, data = data)
summary(model)import pandas as pd
import numpy as np
import statsmodels.api as sm
from statsmodels.stats.anova import anova_lm
np.random.seed(42)
# Create example data
data = pd.DataFrame({
'Method': np.repeat(['Lecture', 'GroupWork', 'Mixed'], 20),
'Gender': np.tile(np.repeat(['Male', 'Female'], 10), 3),
'Grade': np.tile(np.repeat(['9th', '10th'], 5), 6),
'Score': np.random.randint(70, 100, 60)
})
# Fit the model
model = sm.OLS.from_formula('Score ~ Method * Gender * Grade', data=data).fit()
# Get ANOVA table
anova_table = anova_lm(model, typ=3)
print(anova_table)For significant effects:
This calculator helps you analyze the effects of three independent variables (factors) on a dependent variable. It calculates main effects and interaction effects between factors, helping you understand how multiple categorical variables influence your outcome measure. It checks assumptions, provides a detailed ANOVA table, and an APA-style report. for a quick example.
Where:
Test statistic for each factor:
Investigating the effects of teaching method, gender, and grade level on test scores:
| Teaching Method | Gender | Grade | Test Scores |
|---|---|---|---|
| Lecture | Male | 9th | 98 |
| Lecture | Male | 9th | 84 |
| Lecture | Male | 10th | 98 |
| GroupWork | Male | 9th | 72 |
| GroupWork | Male | 10th | 72 |
| ... | |||
For the complete dataset, please refer to the code examples below.
Main Effects:
Interactions:
| Source | SS | df | MS | F | p-value |
|---|---|---|---|---|---|
| Method | 68 | 2 | 34.22 | 0.403 | 0.671 |
| Gender | 180 | 1 | 180.27 | 2.123 | 0.152 |
| Grade | 38 | 1 | 38.40 | 0.452 | 0.504 |
| Method:Gender | 66 | 2 | 32.92 | 0.388 | 0.681 |
| Method:Grade | 218 | 2 | 108.95 | 1.283 | 0.286 |
| Gender:Grade | 4 | 1 | 4.27 | 0.050 | 0.824 |
| Method:Gender:Grade | 137 | 2 | 68.52 | 0.807 | 0.452 |
| Residuals | 4076 | 48 | 84.91 |
library(tidyverse)
set.seed(42)
# Data preparation
data <- tibble(
Method = rep(c("Lecture", "GroupWork", "Mixed"), each = 20),
Gender = rep(rep(c("Male", "Female"), each = 10), 3),
Grade = rep(c("9th", "10th"), each = 5, times = 6),
Score = round(runif(60, min = 70, max = 100))
)
# Run 3-way ANOVA
model <- aov(Score ~ Method * Gender * Grade, data = data)
summary(model)import pandas as pd
import numpy as np
import statsmodels.api as sm
from statsmodels.stats.anova import anova_lm
np.random.seed(42)
# Create example data
data = pd.DataFrame({
'Method': np.repeat(['Lecture', 'GroupWork', 'Mixed'], 20),
'Gender': np.tile(np.repeat(['Male', 'Female'], 10), 3),
'Grade': np.tile(np.repeat(['9th', '10th'], 5), 6),
'Score': np.random.randint(70, 100, 60)
})
# Fit the model
model = sm.OLS.from_formula('Score ~ Method * Gender * Grade', data=data).fit()
# Get ANOVA table
anova_table = anova_lm(model, typ=3)
print(anova_table)For significant effects: