-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Happ Martin
committed
Oct 1, 2018
1 parent
232feac
commit 306774d
Showing
9 changed files
with
95 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
################################################################################ | ||
### File: data.R | ||
### Description: data object | ||
### | ||
################################################################################ | ||
|
||
#' Artifical data of 54 subjects | ||
#' | ||
#' An artificial dataset containing data of 54 subjects where where a substance was administered in three different concentrations (1,2 and 3). | ||
#' This data set can be used to show the paradoxical results obtained from rank tests, i.e., the Hettmansperger-Norton test. | ||
#' | ||
#' The columns are as follows: | ||
#' \itemize{ | ||
#' \item conc. Grouping variable specifying which concentration was used. This factor is ordered, i.e., 1 < 2 < 3. | ||
#' \item score. The response variable. | ||
#' } | ||
#' | ||
#' @docType data | ||
#' @keywords datasets | ||
#' @name ParadoxicalRanks | ||
#' @usage data(ParadoxicalRanks) | ||
#' @format A data frame with 54 rows and 2 variables. | ||
#' @example R/example_paradoxical_results.txt | ||
"ParadoxicalRanks" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
data("ParadoxicalRanks") | ||
dat <- ParadoxicalRanks | ||
|
||
set.seed(1) | ||
n <- c(60, 360, 120) | ||
x1 <- sample(subset(dat, dat$conc == 1)$score, n[1], replace = TRUE) | ||
x2 <- sample(subset(dat, dat$conc == 2)$score, n[2], replace = TRUE) | ||
x3 <- sample(subset(dat, dat$conc == 3)$score, n[3], replace = TRUE) | ||
|
||
|
||
dat <- data.frame(score = c(x1, x2, x3), | ||
conc = factor(c( rep(1,n[1]), rep(2,n[2]), rep(5,n[3]) ), ordered=T) ) | ||
|
||
# Hettmansperger-Norton test with ranks (pseudorannks = FALSE) returns a small p-value (0.011). | ||
# In contrast, the pseudo-rank test returns a large p-value (0.42). By changing the ratio of | ||
# group sizes, we can also obtain a significant decreasing trend with ranks. | ||
hettmansperger_norton_test(score ~ conc, data = dat, pseudoranks = FALSE, | ||
alternative = "increasing") | ||
hettmansperger_norton_test(score ~ conc, data = dat, pseudoranks = TRUE, | ||
alternative = "increasing") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.