FoSSA: Fundamentals of Statistical Software & Analysis
-
Course Information
Meet the Teaching Team -
Course Dataset 1
-
Course Dataset 2
-
MODULE A1: INTRODUCTION TO STATISTICS USING R, STATA, AND SPSSA1.1 What is Statistics?
-
A1.2.1a Introduction to Stata
-
A1.2.2b: Introduction to R
-
A1.2.2c: Introduction to SPSS
-
A1.3: Descriptive Statistics
-
A1.4: Estimates and Confidence Intervals
-
A1.5: Hypothesis Testing
-
A1.6: Transforming Variables
-
End of Module A11 Quiz
-
MODULE A2: POWER & SAMPLE SIZE CALCULATIONSA2.1 Key Concepts
-
A2.2 Power calculations for a difference in means
-
A2.3 Power Calculations for a difference in proportions
-
A2.4 Sample Size Calculation for RCTs
-
A2.5 Sample size calculations for cross-sectional studies (or surveys)
-
A2.6 Sample size calculations for case-control studies
-
End of Module A21 Quiz
-
MODULE B1: LINEAR REGRESSIONB1.1 Correlation and Scatterplots
-
B1.2 Differences Between Means (ANOVA 1)
-
B1.3 Univariable Linear Regression
-
B1.4 Multivariable Linear Regression
-
B1.5 Model Selection and F-Tests
-
B1.6 Regression Diagnostics
-
End of Module B11 Quiz
-
MODULE B2: MULTIPLE COMPARISONS & REPEATED MEASURESB2.1 ANOVA Revisited – Post-Hoc Testing
-
B2.2 Correcting For Multiple Comparisons
-
B2.3 Two-way ANOVA
-
B2.4 Repeated Measures and the Paired T-Test
-
B2.5 Repeated Measures ANOVA
-
End of Module B21 Quiz
-
MODULE B3: NON-PARAMETRIC MEASURESB3.1 The Parametric Assumptions
-
B3.2 Mann-Whitney U Test
-
B3.3 Kruskal-Wallis Test
-
B3.4 Wilcoxon Signed Rank Test
-
B3.5 Friedman Test
-
B3.6 Spearman’s Rank Order Correlation
-
End of Module B31 Quiz
-
MODULE C1: BINARY OUTCOME DATA & LOGISTIC REGRESSIONC1.1 Introduction to Prevalence, Risk, Odds and Rates
-
C1.2 The Chi-Square Test and the Test For Trend
-
C1.3 Univariable Logistic Regression
-
C1.4 Multivariable Logistic Regression
-
End of Module C11 Quiz
-
MODULE C2: SURVIVAL DATAC2.1 Introduction to Survival Data
-
C2.2 Kaplan-Meier Survival Function & the Log Rank Test
-
C2.3 Cox Proportional Hazards Regression
-
C2.4 Poisson Regression
-
End of Module C21 Quiz
-
A Note about the Fossa Certificate
B3.3 Kruskal-Wallis Test
Learning Outcomes
By the end of this section, students will be able to:
- Explain the importance of the parametric assumptions and determine if they have been met
- Explain the basic principles of rank based non-parametric statistical tests
- Describe the use of a range of common non-parametric tests
- Conduct and interpret common non-parametric tests
You can download a copy of the slides here: B3.3 Kruskal-Wallis Test
B3.3 PRACTICAL: R
We can use the kruskal_test command for a comparison between more than two groups. As there is no constraint on the number of groups for the test, we only need to specify the data, followed by the dependent and independent variables in the same was as the previous module.
Question B3.3: Is there a significant difference between all three mouse strains on their BCS_baseline score?
Answer
The R code we use is:
> kruskal_test(mice, BCS_baseline ~ Strain)
The RStudio output looks like:

These results show that there is a significant difference (p<0.05) in the baseline body condition score when comparing all three strains.
B3.3 PRACTICAL: Stata
Following on from the previous practical (B3.2), you can use the Kruskal-Wallis Test to check for differences in baseline body condition score (BCS_baseline) between all three mouse strains.
The command is:
kwallis outcome_variable, by(grouping variable)
Question B3.3: Is there a significant difference between all three mouse strains on their BCS_baseline score?
Answer

We look at the chi-squared value with ties, which is p<0.05. The test indicates the median baseline body composition score of mice was not the same (X2=7.6, p=0.02). Therefore, there is a significant difference in the baseline body condition score when comparing all three groups.
B3.3 PRACTICAL: SPSS
Following on from the previous practical (B3.2), you can use the Kruskal-Wallis Test to check for differences in baseline body condition score (BCS_baseline) between all three mouse strains.
Select
Analyze >> Nonparametric Tests >> Legacy Dialogs >> K Independent Samples
Move the variable of interest (BCS_baseline) into the Test Variable List.
Assign ‘Strain_group’ as the grouping variable and then click ‘Define Range’. Here you need to add the numerical grouping value of the highest and lowest groups of the range you wish to test. As we only have 3 groups here, these values are 1 and 3, but in larger data sets this can be used to specify a subset of groups to compare.
Make sure ‘Kruskal-Wallis H’ is selected at the bottom of the box before you press ‘OK’ to run the test.

Answer


These results show that there is a significant difference in the baseline body condition score when comparing all three groups.
👋 Before you go, leave an anonymous rating & feedback
Average rating 4.8 / 5. Vote count: 24
No votes so far! Be the first to rate this post.
Please share any positive or negative feedback you may have.
Feedback is completely anonymous
Great
Good simplified teaching
Enjoying the lessons