Skip to content

Commit

Permalink
Merge pull request #113 from ACCLAB/revert-112-d2
Browse files Browse the repository at this point in the history
Revert "delta delta function"
  • Loading branch information
josesho authored Jul 26, 2021
2 parents 9b23abf + 386b2eb commit 8775899
Show file tree
Hide file tree
Showing 26 changed files with 2,834 additions and 889,251 deletions.
1,522 changes: 682 additions & 840 deletions R/effectsize.R

Large diffs are not rendered by default.

730 changes: 337 additions & 393 deletions R/main.R

Large diffs are not rendered by default.

2,320 changes: 1,086 additions & 1,234 deletions R/plot.R

Large diffs are not rendered by default.

70,240 changes: 0 additions & 70,240 deletions tests/figs/delta-delta/slopegraph-ddplot-mean-diff-with-legend.svg

This file was deleted.

70,232 changes: 0 additions & 70,232 deletions tests/figs/delta-delta/slopegraph-ddplot-mean-diff-with-no-legend.svg

This file was deleted.

60,202 changes: 0 additions & 60,202 deletions tests/figs/delta-delta/slopegraph-no-ddplot-mean-diff-with-legend.svg

This file was deleted.

60,194 changes: 0 additions & 60,194 deletions tests/figs/delta-delta/slopegraph-no-ddplot-mean-diff-with-no-legend.svg

This file was deleted.

70,636 changes: 0 additions & 70,636 deletions tests/figs/delta-delta/swarmgraph-ddplot-mean-diff-with-legend.svg

This file was deleted.

70,630 changes: 0 additions & 70,630 deletions tests/figs/delta-delta/swarmgraph-ddplot-mean-diff-with-no-legend.svg

This file was deleted.

60,608 changes: 0 additions & 60,608 deletions tests/figs/delta-delta/swarmgraph-no-ddplot-mean-diff-with-legend.svg

This file was deleted.

60,602 changes: 0 additions & 60,602 deletions tests/figs/delta-delta/swarmgraph-no-ddplot-mean-diff-with-no-legend.svg

This file was deleted.

90,226 changes: 0 additions & 90,226 deletions tests/figs/repeated-measures/slopegraph-baseline-multiplot-mean-diff.svg

This file was deleted.

30,160 changes: 0 additions & 30,160 deletions tests/figs/repeated-measures/slopegraph-baseline-timeplot-mean-diff.svg

This file was deleted.

90,222 changes: 0 additions & 90,222 deletions tests/figs/repeated-measures/slopegraph-sequential-multiplot-mean-diff.svg

This file was deleted.

30,156 changes: 0 additions & 30,156 deletions tests/figs/repeated-measures/slopegraph-sequential-timeplot-mean-diff.svg

This file was deleted.

90,874 changes: 0 additions & 90,874 deletions tests/figs/repeated-measures/swarmgraph-baseline-multiplot-mean-diff.svg

This file was deleted.

30,365 changes: 0 additions & 30,365 deletions tests/figs/repeated-measures/swarmgraph-baseline-timeplot-mean-diff.svg

This file was deleted.

152 changes: 45 additions & 107 deletions tests/testthat/helper-generate-dummy-data.R
Original file line number Diff line number Diff line change
@@ -1,107 +1,45 @@
generate.two.groups <- function(sampleN = 40, populationN = 10000,
control_mean = 100, sd = 50,
difference = 25, seed = 54321) {
set.seed(seed)

pop1 <- rnorm(populationN, mean = control_mean, sd = sd)

pop2 <- rnorm(populationN, mean = control_mean + difference, sd = sd)

sample1 <- sample(pop1, sampleN)

sample2 <- sample(pop2, sampleN)

id <- seq(1: sampleN)

my.data <-
tibble::tibble(Control = sample1, Test = sample2, ID = id) %>%
tidyr::gather(key = Group, value = Value, -ID)

return(my.data)
}



generate.canned.data <- function() {
set.seed(54321)

N = 40
c1 <- rnorm(N, mean = 100, sd = 25)
c2 <- rnorm(N, mean = 100, sd = 50)
g1 <- rnorm(N, mean = 120, sd = 25)
g2 <- rnorm(N, mean = 80, sd = 50)
g3 <- rnorm(N, mean = 100, sd = 12)
g4 <- rnorm(N, mean = 100, sd = 50)
gender <- c(rep('Male', N/2), rep('Female', N/2))
id <- 1: N

wide.data <- tibble::tibble(
Control1 = c1, Control2 = c2,
Group1 = g1, Group2 = g2, Group3 = g3, Group4 = g4,
Gender = gender, ID = id)

my.data <- wide.data %>%
tidyr::gather(key = Group, value = Measurement, -ID, -Gender)
}

generate.time.groups <- function(sampleN = 40, populationN = 10000,
control_mean = 100, sd = 50,
difference = 25, seed = 54321) {
set.seed(seed)

# 3 time points
time1 <- rnorm(populationN, mean = control_mean, sd = sd)

time2 <- rnorm(populationN, mean = control_mean + difference, sd = sd)

time3 <- rnorm(populationN, mean = control_mean + difference + difference, sd = sd)

sample1 <- sample(time1, sampleN)

sample2 <- sample(time2, sampleN)

sample3 <- sample(time3, sampleN)

id <- seq(1: sampleN)

my.data <-
tibble::tibble(Timepoint1 = sample1, Timepoint2 = sample2,
Timepoint3 = sample3, ID = id) %>%
tidyr::gather(key = Group, value = Value, -ID)

return(my.data)
}

generate.dd.data <- function() {
ax23.t1 <- c(72, 78, 71, 72, 66, 74, 62, 69)
ax23.t2 <- c(86, 83, 82, 83, 79, 83, 73, 75)
ax23.t3 <- c(81, 88, 81, 83, 77, 84, 78, 76)
ax23.t4 <- c(77, 81, 75, 69, 66, 77, 70, 70)
ax23 <- c(ax23.t1, ax23.t2, ax23.t3, ax23.t4)

bww9.t1 <- c(85, 82, 71, 83, 86, 85, 79, 83)
bww9.t2 <- c(86, 86, 78, 88, 85, 82, 83, 84)
bww9.t3 <- c(83, 80, 70, 79, 76, 83, 80, 78)
bww9.t4 <- c(80, 84, 75, 81, 76, 80, 81, 81)
bww9 <- c(bww9.t1, bww9.t2, bww9.t3, bww9.t4)

ctrl.t1 <- c(69, 66, 84, 80, 72, 65, 75, 71)
ctrl.t2 <- c(73, 62, 90, 81, 72, 62, 69, 70)
ctrl.t3 <- c(72, 67, 88, 77, 69, 65, 69, 65)
ctrl.t4 <- c(74, 73, 87, 72, 70, 61, 68, 65)
ctrl <- c(ctrl.t1, ctrl.t2, ctrl.t3, ctrl.t4)

id <- c(1:8, 1:8, 1:8, 1:8)
treatment <- c(rep("T1", 8), rep("T2", 8),
rep("T3", 8), rep("T4", 8))

Value <- c(ctrl, ax23, bww9)
ids <- c(id, id, id)
Group <- c(paste(treatment, "Control"),
paste(treatment, "AX23"),
paste(treatment, "BWW9"))

data.test3 <- tibble::tibble(ids, Value, Group)

return(data.test3)
}
generate.two.groups <- function(sampleN = 40, populationN = 10000,
control_mean = 100, sd = 50,
difference = 25, seed = 54321) {
set.seed(seed)

pop1 <- rnorm(populationN, mean = control_mean, sd = sd)

pop2 <- rnorm(populationN, mean = control_mean + difference, sd = sd)

sample1 <- sample(pop1, sampleN)

sample2 <- sample(pop2, sampleN)

id <- seq(1: sampleN)

my.data <-
tibble::tibble(Control = sample1, Test = sample2, ID = id) %>%
tidyr::gather(key = Group, value = Value, -ID)

return(my.data)
}



generate.canned.data <- function() {
set.seed(54321)

N = 40
c1 <- rnorm(N, mean = 100, sd = 25)
c2 <- rnorm(N, mean = 100, sd = 50)
g1 <- rnorm(N, mean = 120, sd = 25)
g2 <- rnorm(N, mean = 80, sd = 50)
g3 <- rnorm(N, mean = 100, sd = 12)
g4 <- rnorm(N, mean = 100, sd = 50)
gender <- c(rep('Male', N/2), rep('Female', N/2))
id <- 1: N

wide.data <- tibble::tibble(
Control1 = c1, Control2 = c2,
Group1 = g1, Group2 = g2, Group3 = g3, Group4 = g4,
Gender = gender, ID = id)

my.data <- wide.data %>%
tidyr::gather(key = Group, value = Measurement, -ID, -Gender)
}
Loading

0 comments on commit 8775899

Please sign in to comment.