knitr::opts_chunk$set( collapse = TRUE, comment = "#>" ) library(statease)
statease is an R package designed to simplify statistical analysis by combining a wide range of tests with automatic plain-English interpretation of results. Whether you are a student, researcher, or educator, statease gives you numbers and meaning in one command.
# Install from CRAN install.packages("statease") # Load the package library(statease)
Throughout this vignette we use a simulated dataset of 90 students examining the effect of teaching methods on exam performance.
set.seed(42) tutorial_data <- data.frame( student_id = 1:90, method = rep(c("Traditional", "Online", "Hybrid"), each = 30), gender = rep(c("Male", "Female"), times = 45), exam_score = c( round(rnorm(30, mean = 65, sd = 10)), round(rnorm(30, mean = 72, sd = 10)), round(rnorm(30, mean = 78, sd = 10)) ), pre_test = c( round(rnorm(30, mean = 55, sd = 10)), round(rnorm(30, mean = 58, sd = 10)), round(rnorm(30, mean = 57, sd = 10)) ), age = round(rnorm(90, mean = 22, sd = 3)), passed = rbinom(90, 1, prob = 0.7) ) head(tutorial_data)
The describe() function provides a full summary of a numeric variable
including measures of central tendency, spread, and a normality check.
result <- describe(tutorial_data$exam_score, var_name = "Exam Score") print(result)
You can also extract individual values:
result$mean result$sd result$skew_label
Compare exam scores between male and female students:
males <- tutorial_data$exam_score[tutorial_data$gender == "Male"] females <- tutorial_data$exam_score[tutorial_data$gender == "Female"] result <- ttest_interpret( males, females, var_name = "Exam Score by Gender" ) print(result)
Test whether the average exam score is significantly different from 70:
result <- ttest_interpret( tutorial_data$exam_score, mu = 70, var_name = "Exam Score" ) print(result)
Test whether students improved from pre-test to final exam:
result <- ttest_interpret( tutorial_data$exam_score, tutorial_data$pre_test, paired = TRUE, var_name = "Score Improvement" ) print(result)
Test whether teaching method affects exam scores:
result <- anova_interpret( exam_score ~ method, data = tutorial_data ) print(result)
Test the effect of both teaching method and gender on exam scores:
result <- anova2_interpret( exam_score ~ method * gender, data = tutorial_data ) print(result)
Test the combined effect of teaching method on both exam score and pre-test score simultaneously:
result <- manova_interpret( cbind(exam_score, pre_test) ~ method, data = tutorial_data ) print(result)
Test whether there is an association between teaching method and pass/fail outcome:
tutorial_data$passed_label <- ifelse(tutorial_data$passed == 1, "Pass", "Fail") result <- chisq_interpret( tutorial_data$method, tutorial_data$passed_label ) print(result)
Test the relationship between pre-test scores and exam scores:
result <- cor_interpret( tutorial_data$pre_test, tutorial_data$exam_score, var1_name = "Pre-Test Score", var2_name = "Exam Score" ) print(result)
result <- cor_interpret( tutorial_data$pre_test, tutorial_data$exam_score, method = "spearman", var1_name = "Pre-Test Score", var2_name = "Exam Score" ) print(result)
Predict exam score from pre-test score:
result <- reg_interpret( exam_score ~ pre_test, data = tutorial_data ) print(result)
Predict exam score from both pre-test score and age:
result <- mlr_interpret( exam_score ~ pre_test + age, data = tutorial_data ) print(result)
Predict pass/fail outcome from pre-test score and age:
result <- logistic_interpret( passed ~ pre_test + age, data = tutorial_data ) print(result)
Non-parametric alternative to the independent samples t-test:
result <- mannwhitney_interpret( males, females, var_name = "Exam Score by Gender" ) print(result)
Non-parametric alternative to the paired t-test:
result <- wilcoxon_interpret( tutorial_data$exam_score, tutorial_data$pre_test, var_name = "Score Improvement" ) print(result)
Non-parametric alternative to one-way ANOVA:
result <- kruskal_interpret( exam_score ~ method, data = tutorial_data ) print(result)
Interpret any p-value in plain English:
result <- interpret_p( 0.03, context = "teaching method effect on exam scores" ) print(result)
The analyze() function automatically detects the right test
based on your input — no need to remember which function to use!
# Descriptive statistics analyze(x = tutorial_data$exam_score, var_name = "Exam Score")
# Auto t-test analyze( x = males, y = females, var_name = "Exam Score by Gender" )
# Auto ANOVA analyze(formula = exam_score ~ method, data = tutorial_data)
# Auto non-parametric analyze( formula = exam_score ~ method, data = tutorial_data, nonparam = TRUE )
# Auto regression analyze(formula = exam_score ~ pre_test, data = tutorial_data)
# Auto MANOVA analyze( formula = cbind(exam_score, pre_test) ~ method, data = tutorial_data )
| Test | Function | analyze() support |
|---|---|---|
| Descriptive stats | describe() | ✔ |
| Independent t-test | ttest_interpret() | ✔ |
| One-sample t-test | ttest_interpret() | ✔ |
| Paired t-test | ttest_interpret() | ✔ |
| One-way ANOVA | anova_interpret() | ✔ |
| Two-way ANOVA | anova2_interpret() | ✔ |
| MANOVA | manova_interpret() | ✔ |
| Chi-square | chisq_interpret() | ✔ |
| Correlation | cor_interpret() | ✔ |
| Simple regression | reg_interpret() | ✔ |
| Multiple regression | mlr_interpret() | ✔ |
| Logistic regression | logistic_interpret() | ✔ |
| Mann-Whitney U | mannwhitney_interpret() | ✔ |
| Wilcoxon Signed Rank | wilcoxon_interpret() | ✔ |
| Kruskal-Wallis | kruskal_interpret() | ✔ |
| P-value interpretation | interpret_p() | - |
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.