Skip to content

Commit

Permalink
snap updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ddsjoberg committed Feb 21, 2024
1 parent 23169a2 commit 91760c7
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 112 deletions.
64 changes: 32 additions & 32 deletions tests/testthat/_snaps/ard_cohensd.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,43 @@
Code
as.data.frame(ard_cohensd(cards::ADSL, by = ARM, variable = AGE))
Output
group1 variable context stat_name stat_label statistic
1 ARM AGE cohensd estimate Effect Size Estimate NULL
2 ARM AGE cohensd conf.level CI Confidence Level NULL
3 ARM AGE cohensd conf.low CI Lower Bound NULL
4 ARM AGE cohensd conf_high conf_high NULL
5 ARM AGE cohensd mu mu 0
6 ARM AGE cohensd paired paired FALSE
7 ARM AGE cohensd pooled_sd pooled_sd TRUE
statistic_fmt_fn warning error
1 NULL NULL Grouping variable y must have exactly 2 levels.
2 NULL NULL Grouping variable y must have exactly 2 levels.
3 NULL NULL Grouping variable y must have exactly 2 levels.
4 NULL NULL Grouping variable y must have exactly 2 levels.
5 1 NULL Grouping variable y must have exactly 2 levels.
6 NULL NULL Grouping variable y must have exactly 2 levels.
7 NULL NULL Grouping variable y must have exactly 2 levels.
group1 variable context stat_name stat_label stat fmt_fn warning
1 ARM AGE cohensd estimate Effect Size Estimate NULL NULL NULL
2 ARM AGE cohensd conf.level CI Confidence Level NULL NULL NULL
3 ARM AGE cohensd conf.low CI Lower Bound NULL NULL NULL
4 ARM AGE cohensd conf_high conf_high NULL NULL NULL
5 ARM AGE cohensd mu mu 0 1 NULL
6 ARM AGE cohensd paired paired FALSE NULL NULL
7 ARM AGE cohensd pooled_sd pooled_sd TRUE NULL NULL
error
1 Grouping variable y must have exactly 2 levels.
2 Grouping variable y must have exactly 2 levels.
3 Grouping variable y must have exactly 2 levels.
4 Grouping variable y must have exactly 2 levels.
5 Grouping variable y must have exactly 2 levels.
6 Grouping variable y must have exactly 2 levels.
7 Grouping variable y must have exactly 2 levels.

# ard_paired_cohensd() works

Code
as.data.frame(ard_paired_cohensd(dplyr::mutate(ADSL_paired, ARM = ifelse(dplyr::row_number() ==
1L, "3rd ARM", ARM)), by = ARM, variable = AGE, id = USUBJID))
Output
group1 variable context stat_name stat_label statistic
1 ARM AGE cohensd estimate Effect Size Estimate NULL
2 ARM AGE cohensd conf.level CI Confidence Level NULL
3 ARM AGE cohensd conf.low CI Lower Bound NULL
4 ARM AGE cohensd conf_high conf_high NULL
5 ARM AGE cohensd mu mu 0
6 ARM AGE cohensd paired paired TRUE
7 ARM AGE cohensd pooled_sd pooled_sd TRUE
statistic_fmt_fn warning error
1 NULL NULL The `by` argument must have two and only two levels.
2 NULL NULL The `by` argument must have two and only two levels.
3 NULL NULL The `by` argument must have two and only two levels.
4 NULL NULL The `by` argument must have two and only two levels.
5 1 NULL The `by` argument must have two and only two levels.
6 NULL NULL The `by` argument must have two and only two levels.
7 NULL NULL The `by` argument must have two and only two levels.
group1 variable context stat_name stat_label stat fmt_fn warning
1 ARM AGE cohensd estimate Effect Size Estimate NULL NULL NULL
2 ARM AGE cohensd conf.level CI Confidence Level NULL NULL NULL
3 ARM AGE cohensd conf.low CI Lower Bound NULL NULL NULL
4 ARM AGE cohensd conf_high conf_high NULL NULL NULL
5 ARM AGE cohensd mu mu 0 1 NULL
6 ARM AGE cohensd paired paired TRUE NULL NULL
7 ARM AGE cohensd pooled_sd pooled_sd TRUE NULL NULL
error
1 The `by` argument must have two and only two levels.
2 The `by` argument must have two and only two levels.
3 The `by` argument must have two and only two levels.
4 The `by` argument must have two and only two levels.
5 The `by` argument must have two and only two levels.
6 The `by` argument must have two and only two levels.
7 The `by` argument must have two and only two levels.

117 changes: 37 additions & 80 deletions tests/testthat/_snaps/ard_hedgesg.md
Original file line number Diff line number Diff line change
@@ -1,88 +1,45 @@
# ard_ttest() works
# ard_hedgesg() works

Code
as.data.frame(ard_ttest(cards::ADSL, by = ARM, variable = AGE, var.equal = TRUE))
as.data.frame(ard_hedgesg(cards::ADSL, by = ARM, variable = AGE))
Output
group1 variable context stat_name stat_label statistic
1 ARM AGE ttest estimate Mean Difference NULL
2 ARM AGE ttest estimate1 Group 1 Mean NULL
3 ARM AGE ttest estimate2 Group 2 Mean NULL
4 ARM AGE ttest statistic t Statistic NULL
5 ARM AGE ttest p.value p-value NULL
6 ARM AGE ttest parameter Degrees of Freedom NULL
7 ARM AGE ttest conf.low CI Lower Bound NULL
8 ARM AGE ttest conf.high CI Upper Bound NULL
9 ARM AGE ttest method method NULL
10 ARM AGE ttest alternative alternative NULL
11 ARM AGE ttest mu H0 Mean 0
12 ARM AGE ttest paired Paired t-test FALSE
13 ARM AGE ttest var.equal Equal Variances TRUE
14 ARM AGE ttest conf.level CI Confidence Level 0.95
statistic_fmt_fn warning error
1 NULL NULL grouping factor must have exactly 2 levels
2 NULL NULL grouping factor must have exactly 2 levels
3 NULL NULL grouping factor must have exactly 2 levels
4 NULL NULL grouping factor must have exactly 2 levels
5 NULL NULL grouping factor must have exactly 2 levels
6 NULL NULL grouping factor must have exactly 2 levels
7 NULL NULL grouping factor must have exactly 2 levels
8 NULL NULL grouping factor must have exactly 2 levels
9 NULL NULL grouping factor must have exactly 2 levels
10 NULL NULL grouping factor must have exactly 2 levels
11 1 NULL grouping factor must have exactly 2 levels
12 NULL NULL grouping factor must have exactly 2 levels
13 NULL NULL grouping factor must have exactly 2 levels
14 1 NULL grouping factor must have exactly 2 levels
group1 variable context stat_name stat_label stat fmt_fn warning
1 ARM AGE hedgesg estimate Effect Size Estimate NULL NULL NULL
2 ARM AGE hedgesg conf.level CI Confidence Level NULL NULL NULL
3 ARM AGE hedgesg conf.low CI Lower Bound NULL NULL NULL
4 ARM AGE hedgesg conf_high conf_high NULL NULL NULL
5 ARM AGE hedgesg mu mu 0 1 NULL
6 ARM AGE hedgesg paired paired FALSE NULL NULL
7 ARM AGE hedgesg pooled_sd pooled_sd TRUE NULL NULL
error
1 Grouping variable y must have exactly 2 levels.
2 Grouping variable y must have exactly 2 levels.
3 Grouping variable y must have exactly 2 levels.
4 Grouping variable y must have exactly 2 levels.
5 Grouping variable y must have exactly 2 levels.
6 Grouping variable y must have exactly 2 levels.
7 Grouping variable y must have exactly 2 levels.

# ard_paired_ttest() works
# ard_paired_hedgesg() works

Code
as.data.frame(ard_paired_ttest(dplyr::mutate(ADSL_paired, ARM = ifelse(dplyr::row_number() ==
1L, "3rd ARM", ARM)), by = ARM, variable = AGE, id = USUBJID, var.equal = TRUE))
as.data.frame(ard_paired_hedgesg(dplyr::mutate(ADSL_paired, ARM = ifelse(dplyr::row_number() ==
1L, "3rd ARM", ARM)), by = ARM, variable = AGE, id = USUBJID))
Output
group1 variable context stat_name stat_label statistic
1 ARM AGE ttest estimate Mean Difference NULL
2 ARM AGE ttest estimate1 Group 1 Mean NULL
3 ARM AGE ttest estimate2 Group 2 Mean NULL
4 ARM AGE ttest statistic t Statistic NULL
5 ARM AGE ttest p.value p-value NULL
6 ARM AGE ttest parameter Degrees of Freedom NULL
7 ARM AGE ttest conf.low CI Lower Bound NULL
8 ARM AGE ttest conf.high CI Upper Bound NULL
9 ARM AGE ttest method method NULL
10 ARM AGE ttest alternative alternative NULL
11 ARM AGE ttest mu H0 Mean 0
12 ARM AGE ttest paired Paired t-test TRUE
13 ARM AGE ttest var.equal Equal Variances TRUE
14 ARM AGE ttest conf.level CI Confidence Level 0.95
statistic_fmt_fn warning
1 NULL NULL
2 NULL NULL
3 NULL NULL
4 NULL NULL
5 NULL NULL
6 NULL NULL
7 NULL NULL
8 NULL NULL
9 NULL NULL
10 NULL NULL
11 1 NULL
12 NULL NULL
13 NULL NULL
14 1 NULL
error
1 The `by` argument must have two and only two levels.
2 The `by` argument must have two and only two levels.
3 The `by` argument must have two and only two levels.
4 The `by` argument must have two and only two levels.
5 The `by` argument must have two and only two levels.
6 The `by` argument must have two and only two levels.
7 The `by` argument must have two and only two levels.
8 The `by` argument must have two and only two levels.
9 The `by` argument must have two and only two levels.
10 The `by` argument must have two and only two levels.
11 The `by` argument must have two and only two levels.
12 The `by` argument must have two and only two levels.
13 The `by` argument must have two and only two levels.
14 The `by` argument must have two and only two levels.
group1 variable context stat_name stat_label stat fmt_fn warning
1 ARM AGE hedgesg estimate Effect Size Estimate NULL NULL NULL
2 ARM AGE hedgesg conf.level CI Confidence Level NULL NULL NULL
3 ARM AGE hedgesg conf.low CI Lower Bound NULL NULL NULL
4 ARM AGE hedgesg conf_high conf_high NULL NULL NULL
5 ARM AGE hedgesg mu mu 0 1 NULL
6 ARM AGE hedgesg paired paired TRUE NULL NULL
7 ARM AGE hedgesg pooled_sd pooled_sd TRUE NULL NULL
error
1 The `by` argument must have two and only two levels.
2 The `by` argument must have two and only two levels.
3 The `by` argument must have two and only two levels.
4 The `by` argument must have two and only two levels.
5 The `by` argument must have two and only two levels.
6 The `by` argument must have two and only two levels.
7 The `by` argument must have two and only two levels.

0 comments on commit 91760c7

Please sign in to comment.