Learn/R Programming/Statistical Analysis

Non-Parametric Tests

Topic: Non-Parametric

Advertisement

Introduction

Non-parametric tests don't assume a specific distribution. They're useful when assumptions aren't met.

Wilcoxon Test

# One-sample
wilcox.test(x, mu = 0)

# Two-sample
wilcox.test(group1, group2)

# Paired
wilcox.test(before, after, paired = TRUE)

Mann-Whitney U Test

# Two independent samples
wilcox.test(value ~ group, data = df)

Kruskal-Wallis Test

# Non-parametric ANOVA
kruskal.test(value ~ group, data = df)

Friedman Test

# Repeated measures
friedman.test(value ~ group | subject, data = df)

Spearman Correlation

# Non-parametric correlation
cor.test(x, y, method = "spearman")

Summary

Use non-parametric tests when data doesn't meet parametric assumptions. They are more robust.

Advertisement

Advertisement

Need More Practice?

Get personalized R programming help from ChatWhole's AI-powered platform.

Get Expert Help →