Skip to content

Commit

Permalink
PS T-Test: Report n ties in wilcoxon
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathon-love committed Nov 26, 2018
1 parent e02b785 commit 67e02a4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions R/ttestps.b.R
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ ttestPSClass <- R6::R6Class(
se2 <- sqrt(var2/n)
sd1 <- tryNaN(stats::sd(column1))
sd2 <- tryNaN(stats::sd(column2))
nTies <- sum((column1 - column2) == 0, na.rm=TRUE)

pooledSD <- tryNaN(stats::sd(column1-column2))
sediff <- pooledSD/sqrt(n)
Expand Down Expand Up @@ -117,6 +118,11 @@ ttestPSClass <- R6::R6Class(
'cil[wilc]'=wilc$conf.int[1],
'ciu[wilc]'=wilc$conf.int[2]))

if (nTies > 0) {
message <- paste0(nTies, ' pair(s) of values were tied')
ttestTable$addFootnote(rowKey=pair, 'stat[wilc]', message)
}

} else {

ttestTable$setRow(rowKey=pair, list(
Expand Down

0 comments on commit 67e02a4

Please sign in to comment.