# --- Independent Samples Example (Table 2 from paper) ---
group1_indep <- c(6.62, 6.65, 5.78, 5.63, 6.05, 6.48, 5.50, 5.37)
group2_indep <- c(6.25, 6.95, 5.61, 5.40, 6.89, 6.24, 5.85)
group3_indep <- c(7.11, 5.68, 6.23, 7.11, 5.55, 5.90, 5.98, 7.14)
group4_indep <- c(6.93, 7.17, 7.12, 6.43, 6.96, 7.08, 7.93)
group5_indep <- c(7.26, 6.45, 6.37, 6.54, 6.93, 6.40, 7.01, 7.74, 7.63, 7.62, 7.38)
data_independent <- list(group1_indep, group2_indep, group3_indep, group4_indep, group5_indep)
nonparTrendR_test(data_independent, type = "I", alternative = "increasing")
# --- Dependent Samples Example (Panic Data from paper) ---
panic_data_dep <- matrix(c(
8, 6, 5, 5, 4, 8, 6, 5, 4, 2, 6, 5, 5, 4, 2, 6, 6, 6, 5, 5,
7, 6, 6, 6, 6, 8, 7, 3, 2, 2, 7, 6, 7, 3, 3, 6, 4, 5, 3, 3,
5, 4, 3, 3, 2, 8, 6, 5, 5, 4, 7, 6, 5, 4, 2, 6, 5, 5, 4, 2,
6, 6, 6, 5, 5, 8, 6, 6, 6, 6, 8, 7, 4, 2, 2, 7, 6, 7, 3, 3
), nrow = 16, byrow = TRUE)
# For increasing trend test, data should be ordered such that higher values are expected later.
# If testing for decreasing trend as in your example,
# reverse the columns or use alternative="decreasing"
# Example using original order, testing for decreasing:
nonparTrendR_test(panic_data_dep, type = "D", alternative = "decreasing")
# Example reversing columns to test for increasing trend of "improvement"
nonparTrendR_test(panic_data_dep[, 5:1], type = "D", alternative = "increasing")
Run the code above in your browser using DataLab