Description
A Nonparametric Trend Test for Independent and Dependent Samples.
Description
Implements the nonparametric trend test for one or several samples as proposed by Bathke (2009) <doi:10.1007/s00184-008-0171-x>. The method provides a unified framework for analyzing trends in both independent and dependent data samples, making it a versatile tool for various study designs. The package allows for the evaluation of different trend alternatives, including two-sided (general trend), monotonic increasing, and monotonic decreasing trends. As a nonparametric procedure, it does not require the assumption of data normality, offering a robust alternative to parametric tests.
README.md
๐ nonparTrendR
nonparTrendR
is an R package implementing a nonparametric trend test for independent and dependent samples, based on Bathke (2009). It detects consistent monotonic trends (increasing or decreasing) across time points or ordered groups, while accounting for within-subject correlations in repeated measures.
โจ Features
- ๐ Supports both independent and repeated measures designs.
- ๐ Rank-based test statistic (ฮฝฬ) with two-sided and directional alternatives.
- ๐ Handles within-subject dependencies in longitudinal data.
- โ
Returns standard
htest
objects for easy integration.
๐ Reference
Bathke, A. C. (2009).
A unified approach to nonparametric trend tests for dependent and independent samples.
Metrika, 69(1), 17โ29.
๐ Installation
# Install from CRAN (after release)
install.packages("nonparTrendR")
# Or install development version from GitHub
devtools::install_github("yourusername/nonparTrendR")
๐ Quick Example
Independent samples
library(nonparTrendR)
data_indep <- list(
c(6.62, 6.65, 5.78), # Group 1
c(6.25, 6.95, 5.61), # Group 2
c(7.11, 5.68, 6.23) # Group 3
)
nonparTrendR_test(data_indep, type = "I", alternative = "increasing")
Dependent samples
data_dep <- matrix(c(
8, 6, 5, 5, 4,
7, 6, 6, 6, 6,
6, 5, 5, 4, 2
), nrow = 3, byrow = TRUE)
nonparTrendR_test(data_dep, type = "D", alternative = "decreasing")
๐งช Example Use Cases
- Clinical trials (longitudinal symptom scores)
- Industrial process monitoring
- Customer metrics over time
- Seasonal survey responses.