🧠MindStat

📊 Worked Examples

Step-by-step solutions for the most important statistical tests — with real data, complete formulas, result interpretation, and APA-7 reporting.

💡 Each example includes: research question → data → formula → step-by-step → result → APA-7 report.

📋 1 · Descriptive Statistics

Exam Scores: Central Tendency & Spread
Descriptive
Research Question: A professor records exam scores for 10 students. Describe the distribution.
Student12345678910
Score72859068789275886582
  1. 1
    Mean (x̄):
    $$\bar{x} = \frac{\sum x_i}{n} = \frac{72+85+90+68+78+92+75+88+65+82}{10} = \frac{795}{10} = 79.5$$
  2. 2
    Sample Standard Deviation:
    $$s = \sqrt{\frac{\sum(x_i - \bar{x})^2}{n-1}} = \sqrt{\frac{(-7.5)^2+\cdots+(2.5)^2}{9}} = \sqrt{\frac{630.5}{9}} = \sqrt{70.06} \approx 8.37$$
  3. 3
    Median:
    $$\text{Median} = \frac{x_{(5)} + x_{(6)}}{2} = \frac{78 + 82}{2} = 80.0$$
  4. 4
    SE:
    $$SE = \frac{s}{\sqrt{n}} = \frac{8.37}{\sqrt{10}} = \frac{8.37}{3.162} = 2.65$$
79.5
Mean
80.0
Median
8.37
SD
2.65
SE
65–92
Range
APA-7
Descriptive statistics for exam scores (N = 10): M = 79.50, SD = 8.37, Mdn = 80.00, range = [65, 92].
Open in MindStat

⚖️ 2 · t-Tests

2a · One-Sample t-test
t-test
Research Question: The national average is 75. Does the class (n=10, M=79.5, s=8.37) differ significantly?
Formula
$$t = \frac{\bar{x} - \mu_0}{s/\sqrt{n}}, \quad df = n - 1$$
  1. 1
    H₀: μ = 75  vs  H₁: μ ≠ 75  (two-tailed, α = .05)
  2. 2
    $$t = \frac{79.5 - 75}{8.37/\sqrt{10}} = \frac{4.5}{2.646} = 1.700, \quad df = 9$$
  3. 3
    Critical value: t*(df=9, α=.05) = ±2.262  →  |1.700| < 2.262
  4. 4
    Cohen's d:
    $$d = \frac{\bar{x} - \mu_0}{s} = \frac{79.5 - 75}{8.37} = 0.538 \quad (\text{medium})$$
1.700
t
9
df
.124
p
0.538
Cohen's d
Fail to Reject H₀ — p = .124 > .05
APA-7
A one-sample t-test indicated that the class mean (M = 79.50, SD = 8.37) did not significantly differ from the national standard of 75, t(9) = 1.70, p = .124, d = 0.54, 95% CI [−1.48, 10.48].
2b · Independent-Samples t-test (Welch)
t-test
Research Question: Does Drug A reduce pain scores more than Drug B?
GroupnMeanSD
Drug A124.21.3
Drug B105.81.9
Welch t-statistic
$$t_W = \frac{\bar{x}_1 - \bar{x}_2}{\sqrt{\dfrac{s_1^2}{n_1} + \dfrac{s_2^2}{n_2}}}$$
  1. 1
    $$SE = \sqrt{\frac{1.3^2}{12} + \frac{1.9^2}{10}} = \sqrt{\frac{1.69}{12} + \frac{3.61}{10}} = \sqrt{0.1408 + 0.361} = \sqrt{0.5018} = 0.7084$$
  2. 2
    $$t_W = \frac{4.2 - 5.8}{0.7084} = \frac{-1.6}{0.7084} = -2.258$$
  3. 3
    Welch-Satterthwaite df:
    $$df = \frac{(s_1^2/n_1 + s_2^2/n_2)^2}{\dfrac{(s_1^2/n_1)^2}{n_1-1} + \dfrac{(s_2^2/n_2)^2}{n_2-1}} = \frac{(0.5018)^2}{\dfrac{(0.1408)^2}{11}+\dfrac{(0.361)^2}{9}} \approx 15.7 \approx 15$$
  4. 4
    Cohen's d:
    $$d = \frac{|\bar{x}_1 - \bar{x}_2|}{s_p}, \quad s_p = \sqrt{\frac{(n_1-1)s_1^2+(n_2-1)s_2^2}{n_1+n_2-2}} = \sqrt{\frac{11(1.69)+9(3.61)}{20}} = \sqrt{1.554} = 1.567$$
    $$d = \frac{1.6}{1.567} = 1.021 \quad (\text{large})$$
−2.258
t(Welch)
15
df
.039
p
1.021
Cohen's d
🔴 Reject H₀ — p = .039 < .05
APA-7
An independent-samples Welch t-test revealed that Drug A (M = 4.20, SD = 1.30) produced significantly lower pain scores than Drug B (M = 5.80, SD = 1.90), t(15.00) = −2.26, p = .039, d = 1.02, 95% CI [−3.11, −0.09].
2c · Paired-Samples t-test
t-test
Research Question: Did training improve performance for the same 8 employees?
iBeforeAfterd = After − Befored − d̄(d − d̄)²
16072122.757.56
25568133.7514.06
370755-4.2518.06
465749-0.250.06
55871133.7514.06
672808-1.251.56
763707-2.255.06
86882144.7522.56
Σ81083.00
$$t = \frac{\bar{d}}{s_d / \sqrt{n}}, \quad \bar{d} = \frac{81}{8} = 10.125, \quad s_d = \sqrt{\frac{83.00}{7}} = \sqrt{11.857} = 3.443$$
$$t = \frac{10.125}{3.443/\sqrt{8}} = \frac{10.125}{1.217} = 8.320, \quad df = n-1 = 7$$
Cohen's d (paired)
$$d = \frac{\bar{d}}{s_d} = \frac{10.125}{3.443} = 2.941 \quad (\text{very large})$$
8.320
t
7
df
<.001
p
2.941
Cohen's d
10.125
Mean Diff.
🔴 Reject H₀ — p < .001
APA-7
A paired-samples t-test indicated a statistically significant improvement in performance following training (M_diff = 10.13, SD_diff = 3.44), t(7) = 8.32, p < .001, d = 2.94, 95% CI [7.25, 13.00].

📊 3 · ANOVA

3a · One-Way ANOVA
ANOVA
Research Question: Do three teaching methods produce different exam scores?
Traditional (A)Blended (B)Online (C)
708575
728878
688272
749080
718776
M=71M=86.4M=76.2
ANOVA Decomposition
$$SS_{Total} = SS_{Between} + SS_{Within}$$ $$SS_B = \sum_{j=1}^{k} n_j(\bar{x}_j - \bar{x}_{..})^2, \quad SS_W = \sum_{j=1}^{k}\sum_{i=1}^{n_j}(x_{ij}-\bar{x}_j)^2$$ $$F = \frac{MS_B}{MS_W} = \frac{SS_B/(k-1)}{SS_W/(N-k)}$$
  1. 1
    Grand Mean:
    $$\bar{x}_{..} = \frac{71(5)+86.4(5)+76.2(5)}{15} = \frac{1178}{15} = 77.87$$
  2. 2
    SSBetween:
    $$SS_B = 5(71-77.87)^2 + 5(86.4-77.87)^2 + 5(76.2-77.87)^2$$ $$= 5(47.20) + 5(72.76) + 5(2.79) = 236.0 + 363.8 + 13.9 = 613.7$$
  3. 3
    SSWithin:
    $$SS_W = [(70{-}71)^2{+}(72{-}71)^2{+}\cdots] + \cdots = 20.0 + 38.8 + 42.8 = 101.6$$
  4. 4
    F-statistic:
    $$MS_B = \frac{613.7}{3-1} = 306.85, \quad MS_W = \frac{101.6}{15-3} = 8.467$$ $$F(2, 12) = \frac{306.85}{8.467} = 36.24$$
  5. 5
    η²:
    $$\eta^2 = \frac{SS_B}{SS_T} = \frac{613.7}{613.7+101.6} = \frac{613.7}{715.3} = 0.858 \quad (\text{large, } \eta^2 > .14)$$
36.24
F(2,12)
<.001
p
0.858
η²
306.85
MSB
8.467
MSW
🔴 Reject H₀ — F(2,12) = 36.24, p < .001
APA-7
A one-way ANOVA revealed a significant effect of teaching method, F(2, 12) = 36.24, p < .001, η² = .86. Tukey: Blended > Online > Traditional, all ps < .001.
Open in MindStat

🔢 4 · Non-parametric Tests

4a · Mann-Whitney U Test
Non-parametric
Research Question: Do satisfaction scores differ between two departments?
Dept A68249
Dept B751031
U Statistic
$$U_1 = n_1 n_2 + \frac{n_1(n_1+1)}{2} - R_1, \quad U = \min(U_1, U_2)$$
  1. 1
    Rank all 10 combined (1=lowest):
    Value12345678910
    Rank12345678910
    GroupBABABABAAB
  2. 2
    $$R_1 = 2+4+6+8+9 = 29 \quad (\text{sum of ranks for Dept A})$$ $$U_1 = 5 \times 5 + \frac{5 \times 6}{2} - 29 = 25 + 15 - 29 = 11$$ $$U_2 = n_1 n_2 - U_1 = 25 - 11 = 14, \quad U = \min(11, 14) = 11$$
  3. 3
    Normal approximation (for reference):
    $$z = \frac{U - n_1n_2/2}{\sqrt{n_1 n_2(n_1+n_2+1)/12}} = \frac{11 - 12.5}{\sqrt{25 \times 11/12}} = \frac{-1.5}{4.787} = -0.313$$
  4. 4
    Effect size r:
    $$r = \frac{|z|}{\sqrt{N}} = \frac{0.313}{\sqrt{10}} = 0.099 \quad (\text{small})$$
11
U
.754
p (exact)
0.099
r
Fail to Reject H₀ — p = .754
APA-7
A Mann-Whitney U test revealed no significant difference in satisfaction scores between Department A and B, U = 11, z = −0.31, p = .754, r = .10.
4b · Kruskal-Wallis H Test
Non-parametric
Research Question: Do pain levels differ across three clinics?
Clinic AClinic BClinic C
3,5,4,2,67,9,8,10,65,4,6,3,5
Kruskal-Wallis H
$$H = \frac{12}{N(N+1)}\sum_{j=1}^{k}\frac{R_j^2}{n_j} - 3(N+1)$$
  1. 1
    Rank all 15 values:
    $$R_A = 2+6.5+4+1+9 = 22.5, \quad R_B = 11+14+13+15+9 = 62, \quad R_C = 6.5+4+9+2+6.5 = 28$$
    (ties averaged)
  2. 2
    $$H = \frac{12}{15 \times 16}\left(\frac{22.5^2}{5} + \frac{62^2}{5} + \frac{28^2}{5}\right) - 3(16)$$ $$= \frac{12}{240}(101.25 + 768.8 + 156.8) - 48 = 0.05(1026.85) - 48 = 51.34 - 48 = 3.34$$
  3. 3
    Compare to χ²(2) = 5.99 → H = 3.34 < 5.99
3.34
H
2
df
.188
p
Fail to Reject H₀ — p = .188
APA-7
A Kruskal-Wallis test indicated no significant difference in pain levels across clinics, H(2) = 3.34, p = .188, η² = .10.

🔗 5 · Correlation

5a · Pearson Correlation
Correlation
Research Question: Is there a linear relationship between study hours and GPA?
iX (hrs)Y (GPA)X−X̄Y−Ȳ(X−X̄)(Y−Ȳ)(X−X̄)²(Y−Ȳ)²
1102.8-5-0.552.75250.30
2153.20-0.15000.02
3203.850.452.25250.20
4123.0-3-0.351.0590.12
5183.630.250.7590.06
682.5-7-0.855.95490.72
7224.070.654.55490.42
8153.30-0.05000.003
Σ12027.20017.301661.843
$$r = \frac{\sum(x_i-\bar{x})(y_i-\bar{y})}{\sqrt{\sum(x_i-\bar{x})^2 \cdot \sum(y_i-\bar{y})^2}} = \frac{17.30}{\sqrt{166 \times 1.843}} = \frac{17.30}{\sqrt{305.9}} = \frac{17.30}{17.49} = 0.989$$
Significance test (t)
$$t = \frac{r\sqrt{n-2}}{\sqrt{1-r^2}} = \frac{0.989\sqrt{6}}{\sqrt{1-0.978}} = \frac{0.989 \times 2.449}{\sqrt{0.022}} = \frac{2.422}{0.148} = 16.36, \quad df=6$$
95% CI (Fisher-z)
$$z_r = \tanh^{-1}(r) = \frac{1}{2}\ln\frac{1+r}{1-r} = \frac{1}{2}\ln\frac{1.989}{0.011} = 2.693$$ $$CI_{z}: 2.693 \pm \frac{1.96}{\sqrt{n-3}} = 2.693 \pm 0.981 \Rightarrow [1.712,\ 3.674] \Rightarrow r \in [.936,\ .998]$$
.989
r
.978
16.36
t(6)
<.001
p
🔴 Strong positive correlation, r = .989, p < .001
APA-7
Study hours and GPA were strongly positively correlated, r(6) = .99, p < .001, 95% CI [.94, 1.00]. Study hours accounted for 97.8% of the variance in GPA.

📈 6 · Simple Linear Regression

Predict GPA from Study Hours
Regression
Research Question: Predict GPA from study hours (same data as correlation example).
OLS Coefficients
$$b_1 = \frac{\sum(x_i-\bar{x})(y_i-\bar{y})}{\sum(x_i-\bar{x})^2} = \frac{17.30}{166} = 0.1042$$ $$b_0 = \bar{y} - b_1\bar{x} = 3.40 - 0.1042 \times 15 = 3.40 - 1.563 = 1.837$$ $$\hat{y} = 1.837 + 0.1042x$$
R², F, SE
$$SS_{Res} = \sum(y_i - \hat{y}_i)^2 = 0.040, \quad SS_{Tot} = 1.843$$ $$R^2 = 1 - \frac{SS_{Res}}{SS_{Tot}} = 1 - \frac{0.040}{1.843} = 0.978$$ $$F(1,6) = \frac{R^2/(p-1)}{(1-R^2)/(n-p)} = \frac{0.978/1}{0.022/6} = \frac{0.978}{0.00367} = 267.0$$ $$SE_{b_1} = \sqrt{\frac{SS_{Res}/(n-2)}{\sum(x-\bar{x})^2}} = \sqrt{\frac{0.040/6}{166}} = \sqrt{0.0000402} = 0.00634$$
CoefficientBSEtp95% CI
b₀ (Intercept)1.8370.10717.17<.001[1.575, 2.099]
b₁ (Hours)0.10420.0063416.44<.001[0.0887, 0.1197]
0.978
267.0
F(1,6)
<.001
p
0.1042
β (slope)
Every additional hour → GPA +0.104. R² = 97.8%.
APA-7
Simple linear regression: GPA = 1.84 + 0.10 × Hours, F(1, 6) = 267.0, p < .001, R² = .978.

🗂️ 7 · Chi-Square Test

Smoking vs Cancer
Categorical
Research Question: Is smoking associated with cancer diagnosis (N=200)?
Cancer: YesCancer: NoRow Total
Smoker50 (E=32)30 (E=48)80
Non-Smoker30 (E=48)90 (E=72)120
Col Total80120200
Expected: E = (R × C) / N
$$E_{11} = \frac{80 \times 80}{200} = 32, \quad E_{12} = \frac{80 \times 120}{200} = 48$$ $$E_{21} = \frac{120 \times 80}{200} = 48, \quad E_{22} = \frac{120 \times 120}{200} = 72$$
χ²
$$\chi^2 = \sum \frac{(O-E)^2}{E} = \frac{(50-32)^2}{32} + \frac{(30-48)^2}{48} + \frac{(30-48)^2}{48} + \frac{(90-72)^2}{72}$$ $$= \frac{324}{32} + \frac{324}{48} + \frac{324}{48} + \frac{324}{72} = 10.125 + 6.75 + 6.75 + 4.5 = 28.125$$
Cramér's V
$$V = \sqrt{\frac{\chi^2}{N \cdot \min(r-1,c-1)}} = \sqrt{\frac{28.125}{200 \times 1}} = \sqrt{0.1406} = 0.375 \quad (\text{medium-large})$$
28.125
χ²
1
df
<.001
p
0.375
Cramér's V
🔴 Reject H₀ — p < .001. Smoking and cancer are significantly associated.
APA-7
A chi-square test of independence indicated a significant association between smoking and cancer, χ²(1, N = 200) = 28.13, p < .001, V = .375.

🔒 8 · Cronbach's Alpha

5-Item Job Satisfaction Scale
Reliability
Research Question: Is this 5-item Likert satisfaction scale internally consistent?
Resp.Q1Q2Q3Q4Q5Sum
14354319
22232211
35455423
43343316
5122128
64544522
2.071.271.272.271.07σ²_T=28.56
Cronbach's α
$$\alpha = \frac{k}{k-1}\left(1 - \frac{\sum s_i^2}{\sigma_T^2}\right)$$ $$\sum s_i^2 = 2.07+1.27+1.27+2.27+1.07 = 7.95$$ $$\alpha = \frac{5}{4}\left(1 - \frac{7.95}{28.56}\right) = 1.25 \times (1 - 0.2783) = 1.25 \times 0.7217 = 0.902$$
0.902
α
5
Items
Excellent
Rating
α = .902 — Excellent internal consistency (α > .90)
APA-7
The internal consistency of the 5-item job satisfaction scale was excellent, α = .90, exceeding the recommended threshold of .70.

🔁 9 · Repeated-Measures ANOVA

Memory Scores: 3 Time Points
RM-ANOVA
Research Question: Do memory scores change over 3 time points in 5 participants?
Subj.T1T2T3
14686.0
25797.0
33575.0
468108.0
52464.0
T̄ⱼ4.06.08.06.0 (Grand)
SS Decomposition
$$SS_{Time} = n\sum_j(\bar{T}_j - \bar{x}_{..})^2 = 5[(4{-}6)^2+(6{-}6)^2+(8{-}6)^2] = 5[4+0+4] = 40$$ $$SS_{Subjects} = k\sum_i(\bar{P}_i - \bar{x}_{..})^2 = 3[(6{-}6)^2+(7{-}6)^2+(5{-}6)^2+(8{-}6)^2+(4{-}6)^2] = 3[0+1+1+4+4] = 30$$ $$SS_{Error} = SS_{Total} - SS_{Time} - SS_{Subjects}$$ $$SS_{Total} = \sum(x_{ij}-\bar{x}_{..})^2 = 70, \quad SS_{Error} = 70 - 40 - 30 = 0$$
$$F = \frac{MS_{Time}}{MS_{Error}} = \frac{40/2}{0/8} \rightarrow \infty \quad \text{(perfect linear trend — theoretical)}$$ $$\eta^2_{partial} = \frac{SS_{Time}}{SS_{Time}+SS_{Error}} = \frac{40}{40+0} = 1.000$$
📌 In real data: use MindStat for Mauchly's test + GG/HF corrections.
APA-7 (template)
A one-way RM-ANOVA indicated a significant effect of time, F(2, 8) = XX, p < .001, η²_p = .XX. Pairwise Bonferroni comparisons: all periods differ significantly.
Open in MindStat

10 · Power Analysis & Sample Size

Sample Size for Independent t-test
Power
Scenario: Two-group RCT, d = 0.5 (medium), α = .05, power = .80.
Cohen's n per group
$$n = \frac{(z_{\alpha/2} + z_\beta)^2 \times 2}{d^2}$$ $$z_{\alpha/2} = z_{.025} = 1.96, \quad z_\beta = z_{.20} = 0.842$$ $$n = \frac{(1.96 + 0.842)^2 \times 2}{0.5^2} = \frac{(2.802)^2 \times 2}{0.25} = \frac{7.851 \times 2}{0.25} = \frac{15.70}{0.25} = 62.8 \approx \mathbf{63 \text{ per group}}$$
d80% Power90% Power95% Power
0.2 (small)197265327
0.5 (medium)6385105
0.8 (large)263442
1.0 (very large)172227
63
n per group
126
Total N
80%
Power
APA-7
An a priori power analysis indicated that 63 participants per group (N = 126) were required to detect d = 0.50 with 80% power at α = .05 (two-tailed).
Power Analysis in MindStat

📐 11 · Normality Testing (Shapiro-Wilk)

11a · Data Consistent with Normality
Normality
Research Question: Are BP readings normally distributed before applying a t-test?
i12345678910
BP118120122124124126128130133135
Shapiro-Wilk W
$$W = \frac{b^2}{SS},\quad b = \sum_{i=1}^{\lfloor n/2\rfloor} a_i\bigl(x_{(n+1-i)}-x_{(i)}\bigr),\quad SS=\sum(x_i-\bar{x})^2$$
  1. 1
    Sort ascending, compute x̄ and SS
    $$\bar{x}=126.0,\quad SS=(118{-}126)^2+\cdots+(135{-}126)^2=274$$
  2. 2
    Coefficients (n=10): a₁=0.5739, a₂=0.3291, a₃=0.2141, a₄=0.1224, a₅=0.0399
    $$x_{(10)}-x_{(1)}=17,\; x_{(9)}-x_{(2)}=13,\; x_{(8)}-x_{(3)}=8,\; x_{(7)}-x_{(4)}=4,\; x_{(6)}-x_{(5)}=2$$ $$b=0.5739(17)+0.3291(13)+0.2141(8)+0.1224(4)+0.0399(2)=9.756+4.278+1.713+0.490+0.080=16.317$$
  3. 3
    $$W=\frac{(16.317)^2}{274}=\frac{266.2}{274}=\mathbf{0.972}$$
0.972
W
.895
p
10
n
Fail to Reject H₀ — Normality confirmed, W(10) = 0.97, p = .895
APA-7
Shapiro-Wilk testing confirmed normality, W(10) = 0.97, p = .895.
11b · Detecting Non-Normality
Non-Normal
Research Question: Are ER waiting times normally distributed?
i12345678910
Min581012152035527895
  1. 1
    $$\bar{x}=33.0,\quad SS=9{,}106$$ $$\text{Differences: }x_{(10)}-x_{(1)}=90,\;70,\;42,\;23,\;5$$ $$b=0.5739(90)+0.3291(70)+0.2141(42)+0.1224(23)+0.0399(5)=51.65+23.04+8.99+2.82+0.20=86.70$$ $$W=\frac{(86.70)^2}{9106}=\frac{7516.9}{9106}=\mathbf{0.825}$$
0.825
W
.030
p
<.05
Violation
🔴 Reject H₀ — Data NOT normal, W(10) = 0.83, p = .030 → use non-parametric test
💡 Decision rule: p > .05 → normality assumed; p ≤ .05 → non-parametric or transform data.
Test Normality in MindStat

🔀 12 · Two-Way ANOVA (Factorial Design)

Teaching Method × Class Size Interaction
ANOVA
Research Question: Does teaching method's effect depend on class size? 2×2 factorial, N=24.
SmallLargeRow Mean
Traditional68.070.069.0
Active82.074.078.0
Col Mean75.072.073.0 (GM)
SS Formulas
$$SS_A = n \cdot k_B \cdot \sum(\bar{M}_{A_i}-\text{GM})^2,\quad SS_B = n \cdot k_A \cdot \sum(\bar{M}_{B_j}-\text{GM})^2$$ $$SS_{A\times B} = n \cdot \sum\bigl(M_{ij}-\bar{M}_{A_i}-\bar{M}_{B_j}+\text{GM}\bigr)^2$$
  1. 1
    Main Effect A — Teaching Method
    $$SS_A = 6\times2\times\bigl[(69.0-73.0)^2+(78.0-73.0)^2\bigr]=12\times[16+25]=\mathbf{492}$$ $$F_A=\frac{492/1}{30.25}=16.27,\quad p=.001$$
  2. 2
    Main Effect B — Class Size
    $$SS_B = 6\times2\times\bigl[(75.0-73.0)^2+(72.0-73.0)^2\bigr]=12\times[4+1]=\mathbf{60}$$ $$F_B=\frac{60/1}{30.25}=1.98,\quad p=.174$$
  3. 3
    Interaction A×B
    $$\text{Residuals: }(68{-}69{-}75{+}73)=-3,\;(70{-}69{-}72{+}73)=2,\;(82{-}78{-}75{+}73)=2,\;(74{-}78{-}72{+}73)=-3$$ $$SS_{A\times B}=6\times[(-3)^2+2^2+2^2+(-3)^2]=6\times26=\mathbf{156},\quad F_{A\times B}=\frac{156}{30.25}=5.16,\quad p=.034$$
  4. 4
    Interpret: Active Learning gains +14 pts in small classes but only +4 pts in large classes — the interaction is meaningful.
SourceSSdfMSFpη²p
Method (A)492149216.27.001.448
Class Size (B)601601.98.174.090
A × B15611565.16.034.205
Error6052030.25
Total131323
Significant A×B interaction, F(1,20) = 5.16, p = .034
APA-7
A 2×2 ANOVA showed a significant Method × Class Size interaction, F(1, 20) = 5.16, p = .034, η²p = .21. Active Learning gained +14 points in small classes but only +4 in large classes.
Two-Way ANOVA in MindStat

🏅 13 · Spearman Rank Correlation

Study Hours Rank vs Exam Rank
Spearman
Research Question: Monotonic relationship between study hours rank and exam rank (n=8)?
StudentHoursRank XExamRank Yd = Rₓ−Rᵧ
A31622−11
B4255111
C5368300
D64745−11
E7571411
F86857−11
G9780611
H10891800
Σ06
Spearman's rₛ
$$r_s = 1 - \frac{6\sum d_i^2}{n(n^2-1)} = 1 - \frac{6\times 6}{8(64-1)} = 1 - \frac{36}{504} = 1 - 0.071 = \mathbf{0.929}$$
t-test for rₛ
$$t = r_s\sqrt{\frac{n-2}{1-r_s^2}} = 0.929\sqrt{\frac{6}{1-0.863}} = 0.929\times\sqrt{43.8} = 0.929\times 6.62 = \mathbf{6.15},\quad df=6$$
.929
rₛ
6.15
t(6)
<.001
p
Large
Effect
🔴 Strong monotonic relationship, rₛ(6) = .929, p < .001
APA-7
A Spearman correlation indicated a strong positive relationship, rₛ(6) = .93, p < .001.
💡 Use Spearman when data is ordinal, non-normal, or contains outliers.
Spearman Correlation in MindStat

📊 14 · Multiple Linear Regression

Exam Score ← Study Hours + Sleep Hours
Multiple Reg.
Research Question: Can study hours and sleep hours together predict exam score (n=10)?
iX₁ (Study)X₂ (Sleep)Y (Score)Ŷe = Y−Ŷ
1465855.32.7
2676464.7−0.7
3887274.0−2.0
4555556.1−1.1
5987877.40.6
6777068.11.9
71098583.41.6
8365251.90.1
9866868.9−0.9
10686567.2−2.2
6.67.066.7
OLS solution
$$S_{x_1x_1}=44.4,\quad S_{x_2x_2}=14.0,\quad S_{x_1x_2}=18.0$$ $$S_{yx_1}=196.8,\quad S_{yx_2}=97.0$$ $$b_1=\frac{S_{yx_1}S_{x_2x_2}-S_{yx_2}S_{x_1x_2}}{S_{x_1x_1}S_{x_2x_2}-S_{x_1x_2}^2}=\frac{196.8\times14-97.0\times18}{44.4\times14-18^2}=\frac{1009.2}{297.6}=\mathbf{3.39}$$ $$b_2=\frac{S_{yx_2}S_{x_1x_1}-S_{yx_1}S_{x_1x_2}}{297.6}=\frac{764.4}{297.6}=\mathbf{2.57}$$ $$b_0=\bar{Y}-b_1\bar{X}_1-b_2\bar{X}_2=66.7-3.39(6.6)-2.57(7.0)=\mathbf{26.34}$$ $$\hat{Y}=26.34+3.39X_1+2.57X_2$$
PredictorbSEtp95% CIβ (std)
Intercept26.344.186.30<.001[17.1, 35.6]
Study Hours3.390.418.27<.001[2.4, 4.4].74
Sleep Hours2.570.743.47.010[0.9, 4.2].32
R², Adjusted R², F
$$SS_{tot}=942.1,\quad SS_{res}=25.6,\quad SS_{reg}=916.5$$ $$R^2=\frac{916.5}{942.1}=\mathbf{.973},\quad R^2_{adj}=1-\frac{25.6/7}{942.1/9}=\mathbf{.965}$$ $$F(2,7)=\frac{916.5/2}{25.6/7}=\frac{458.3}{3.66}=\mathbf{125.2},\quad p<.001$$
.973
.965
Adj R²
125.2
F(2,7)
<.001
p
Model explains 97.3% of variance — study hours (β=.74) and sleep hours (β=.32) both significant.
APA-7
Multiple regression: F(2, 7) = 125.2, p < .001, R² = .973. Study hours (β=.74, p<.001) and sleep hours (β=.32, p=.010) both predicted exam scores.
Multiple Regression in MindStat

⚙️ 15 · Logistic Regression

Predict Pass/Fail from Study Hours
Logistic
Research Question: Does study hours predict pass/fail probability (n=20)?
Logistic Model
$$P(\text{pass})=\frac{1}{1+e^{-(b_0+b_1 X)}}=\frac{e^{b_0+b_1 X}}{1+e^{b_0+b_1 X}}$$
  1. 1
    Maximum likelihood estimates
    $$b_0=-8.76\;(SE=3.42),\quad b_1=1.12\;(SE=0.48)$$ $$\hat{Y}=\frac{1}{1+e^{-(-8.76+1.12X)}}$$
  2. 2
    Predicted probabilities
    Study hrs678910
    P(pass).115.283.550.798.922
    $$\text{At }X=8:\quad P(\text{pass})=\frac{1}{1+e^{-(-8.76+8.96)}}=\frac{1}{1+e^{-0.20}}=\frac{1}{1.819}=\mathbf{0.55}$$
  3. 3
    Odds Ratio (OR)
    $$OR = e^{b_1} = e^{1.12} = \mathbf{3.06}\quad\text{95% CI: }[1.19,\;7.87]$$ $$\text{Each additional study hour multiplies the odds of passing by 3.06×}$$
  4. 4
    Model fit
    $$\text{Overall model: }\chi^2(1)=14.5,\;p<.001,\quad\text{Nagelkerke }R^2=.72$$ $$\text{Wald test: }\chi^2(1)=5.44,\;p=.020\quad\text{(for }b_1\text{)}$$ $$\text{Correctly classified: }85\%$$
3.06
OR
<.001
Model p
.72
Nagelkerke R²
85%
Classified
Study hours predicts pass/fail, OR = 3.06, p < .001
APA-7
Logistic regression: Study hours predicted pass/fail, χ²(1) = 14.5, p < .001, OR = 3.06, 95% CI [1.19, 7.87].
Logistic Regression in MindStat

🎯 16 · Effect Sizes

Four Effect Size Measures with Worked Examples
Effect Size
Effect size measures the practical importance of a finding, independent of sample size.
Cohen's d — for t-tests
Cohen's d
$$d = \frac{M_1-M_2}{SD_{pooled}},\quad SD_{pooled}=\sqrt{\frac{(n_1-1)SD_1^2+(n_2-1)SD_2^2}{n_1+n_2-2}}$$
Worked example
$$SD_{pooled}=\sqrt{\frac{14(6.5)^2+14(5.9)^2}{28}}=\sqrt{\frac{592+487}{28}}=\sqrt{38.5}=6.21$$ $$d=\frac{82-76}{6.21}=\frac{6}{6.21}=\mathbf{0.97}\quad(\text{large})$$
Eta-squared η² — for ANOVA
$$\eta^2=\frac{SS_{between}}{SS_{total}},\quad \omega^2=\frac{SS_{between}-df_{between}\cdot MS_{within}}{SS_{total}+MS_{within}}\;(\text{less biased})$$ $$\text{Example: }SS_{between}=180,\;SS_{total}=520 \;\Rightarrow\; \eta^2=\frac{180}{520}=\mathbf{.346}\quad(\text{large})$$
Cramér's V — for χ²
$$V=\sqrt{\frac{\chi^2}{n\cdot\min(r-1,\;c-1)}}$$ $$\text{Example: }\chi^2=8.64,\;n=45,\;2\times2\text{ table} \;\Rightarrow\; V=\sqrt{\frac{8.64}{45\times1}}=\sqrt{.192}=\mathbf{.438}\quad(\text{large})$$
r (non-parametric effect size)
$$r=\frac{|z|}{\sqrt{N}}$$ $$\text{Example: }z=-2.45,\;N=30 \;\Rightarrow\; r=\frac{2.45}{\sqrt{30}}=\frac{2.45}{5.48}=\mathbf{.447}\quad(\text{medium-large})$$
MeasureUse withSmallMediumLarge
Cohen's dt-tests0.200.500.80
η² (eta-squared)ANOVA.01.06.14
η²p (partial)Factorial ANOVA.01.06.14
Cramér's VChi-square.10.30.50
r (Pearson/Spearman)Correlation.10.30.50
r (z/√N)Mann-Whitney.10.30.50
💡 Cohen's thresholds are benchmarks, not rules — interpret effect sizes in context.
Compute Effect Sizes in MindStat

📏 17 · Confidence Intervals

Three CI Types — Mean, Proportion, Difference
CI
95% CI for a Single Mean
Scenario: n=30 BP readings, M=128.4, SD=14.2 → 95% CI
$$CI=\bar{X}\pm t^*\frac{SD}{\sqrt{n}},\quad SE=\frac{14.2}{\sqrt{30}}=\frac{14.2}{5.477}=2.593,\quad t^*_{(29,\,0.025)}=2.045$$ $$CI=128.4\pm2.045\times2.593=128.4\pm5.30=\mathbf{[123.1,\;133.7]\text{ mmHg}}$$
128.4
Mean
±5.3
Margin
[123.1, 133.7]
95% CI
95% CI for a Proportion
Scenario: 142/200 patients satisfied (p̂=0.71) → 95% CI
$$CI=\hat{p}\pm z^*\sqrt{\frac{\hat{p}(1-\hat{p})}{n}},\quad SE=\sqrt{\frac{0.71\times0.29}{200}}=\sqrt{0.001030}=0.0321,\quad z^*=1.96$$ $$CI=0.71\pm1.96\times0.0321=0.71\pm0.063=\mathbf{[0.647,\;0.773]}$$
71.0%
±6.3%
Margin
[64.7%, 77.3%]
95% CI
95% CI for Difference Between Two Means
Drug (M=85.2, SD=7.4) vs Placebo (M=79.6, SD=8.1), n=20 each → 95% CI for M₁−M₂
$$SD_p=\sqrt{\frac{19(7.4)^2+19(8.1)^2}{38}}=\sqrt{\frac{1038+1246}{38}}=\sqrt{60.1}=7.75$$ $$SE_{diff}=SD_p\sqrt{\frac{1}{n_1}+\frac{1}{n_2}}=7.75\sqrt{\frac{2}{20}}=7.75\times0.316=2.45$$ $$CI=(85.2-79.6)\pm t^*_{(38)}\times2.45=6.0-2.024\times2.45\;\Rightarrow\;\mathbf{[1.04,\;10.96\text{ points}]}$$
6.0
Δ Mean
±4.96
Margin
[1.04, 10.96]
95% CI
CI excludes 0 → significant difference. Drug improves score by 1–11 points.
APA-7
95% CI for the mean difference = [1.04, 10.96]; excludes zero → significant at α = .05.
Confidence Intervals in MindStat

🔄 18 · Mediation Analysis

Mindfulness → Stress → Anxiety (Simple Mediation)
Mediation
Research Question: Does mindfulness reduce anxiety indirectly through stress? N=90.
PathDescriptionbSEtp
aTraining → Stress−6.401.30−4.92<.001
bStress → Anxiety0.620.115.64<.001
cTotal effect (c)−7.801.90−4.11<.001
c'Direct effect (c')−3.831.82−2.11.037
Indirect Effect = a × b
$$\text{Indirect effect}=a\times b=(-6.40)\times(0.62)=\mathbf{-3.97}$$ $$\text{Bootstrap 95\% CI for }ab:\;[-6.12,\;-1.94]\quad\text{(excludes 0 → significant mediation)}$$ $$\text{Proportion mediated}=\frac{|ab|}{|c|}=\frac{3.97}{7.80}=\mathbf{50.9\%}$$
−3.97
Indirect
[−6.12, −1.94]
Boot CI
50.9%
Mediated
Significant partial mediation: 51% of training's effect on anxiety is through stress reduction.
APA-7
Simple mediation: ab = −3.97, 95% bootstrap CI [−6.12, −1.94]; 51% of total effect mediated through stress. Partial mediation (direct effect c' = −3.83, p = .037 remains).
💡 Full mediation: c' non-significant. Partial: c' remains significant. Use bootstrap CIs, not Sobel test.
Mediation Analysis in MindStat

📉 19 · Survival Analysis (Kaplan-Meier)

Time-to-Relapse: Drug A vs Drug B
Survival
Research Question: Does Drug A prolong relapse-free survival vs Drug B? (†=censored)
Drug A (n=12)358111520†22†24†24†26†28†30†
Drug B (n=12)246810141820†22†24†26†28†
  1. 1
    KM formula: S(tⱼ) = S(tⱼ₋₁) × (1 − dⱼ/nⱼ)
    t (months)nⱼ (at risk)dⱼ (events)1−dⱼ/nⱼS(t) Drug A
    01201.000
    312111/120.917
    511110/110.833
    81019/100.750
    11918/90.667
    15716/70.571
  2. 2
    Summary statistics
    Median SurvivalS(12 mo)Events/N
    Drug A22 months0.7505/12
    Drug B14 months0.5007/12
  3. 3
    Log-rank test
    $$\chi^2_{log-rank}=\frac{(O_1-E_1)^2}{E_1}+\frac{(O_2-E_2)^2}{E_2}=5.02,\quad df=1,\quad p=.025$$
22 mo
Median A
14 mo
Median B
5.02
χ²(1)
.025
p
Drug A significantly prolongs survival: 22 vs 14 months, p = .025
APA-7
Kaplan-Meier analysis: Drug A (median = 22 mo) vs Drug B (median = 14 mo), log-rank χ²(1) = 5.02, p = .025. At 12 months, 75% vs 50% remained relapse-free.
💡 Censored observations (†) contribute data up to their last follow-up. KM correctly handles censoring.
Survival Analysis in MindStat