Skip to content

Commit a21054e

Browse files
add tests for residual.R, bump up version (#433)
1 parent 41b21ff commit a21054e

File tree

4 files changed

+40
-9
lines changed

4 files changed

+40
-9
lines changed

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
Type: Package
22
Package: mmrm
33
Title: Mixed Models for Repeated Measures
4-
Version: 0.3.10.9006
4+
Version: 0.3.11
55
Authors@R: c(
66
person("Daniel", "Sabanes Bove", , "daniel.sabanes_bove@roche.com", role = c("aut", "cre")),
7+
person("Liming", "Li", , "liming.li@roche.com", role = "aut"),
78
person("Julia", "Dedic", , "julia.dedic@roche.com", role = "aut"),
89
person("Doug", "Kelkhoff", , "doug.kelkhoff@roche.com", role = "aut"),
910
person("Kevin", "Kunzmann", , "kevin.kunzmann@boehringer-ingelheim.com", role = "aut"),
1011
person("Brian Matthew", "Lang", , "brian.lang@msd.com", role = "aut"),
11-
person("Liming", "Li", , "liming.li@roche.com", role = "aut"),
1212
person("Christian", "Stock", , "christian.stock@boehringer-ingelheim.com", role = "aut"),
1313
person("Ya", "Wang", , "ya.wang10@gilead.com", role = "aut"),
1414
person("Craig", "Gower-Page", , "craig.gower-page@roche.com", role = "ctb"),

NEWS.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
# mmrm 0.3.10.9006
2-
3-
### Miscellaneous
4-
5-
- Fix internal test skipping functions for MacOS R.
1+
# mmrm 0.3.11
62

73
### Bug Fixes
84

95
- Previously if a secondary optimizer fails `mmrm` will fail. This is fixed now.
10-
- Previously character covariate variable will make `Anova` fail. This is fixed now.
6+
- Previously character covariate variables will make `Anova` fail. This is fixed now.
7+
8+
# mmrm 0.3.10
9+
10+
### Miscellaneous
11+
12+
- Fix internal test skipping functions for MacOS R.
1113

1214
# mmrm 0.3.9
1315

man/mmrm-package.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/testthat/test-residual.R

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# h_df_1d_res ----
2+
3+
test_that("h_df_1d_res works as expected", {
4+
fit <- get_mmrm()
5+
contrast <- numeric(length = length(coef(fit)))
6+
contrast[2] <- 1
7+
result <- expect_silent(h_df_1d_res(fit, contrast))
8+
expect_list(result)
9+
expect_equal(result$est, 1.5305, tolerance = 1e-3)
10+
expect_equal(result$se, 0.6245, tolerance = 1e-3)
11+
expect_identical(result$df, 526L)
12+
expect_equal(result$t_stat, 2.4509, tolerance = 1e-3)
13+
expect_equal(result$p_val, 0.01458, tolerance = 1e-3)
14+
})
15+
16+
# h_df_md_res ----
17+
18+
test_that("h_df_md_res works as expected", {
19+
fit <- get_mmrm()
20+
contrast <- matrix(data = 0, ncol = length(coef(fit)), nrow = 2)
21+
contrast[1, 2] <- 1
22+
contrast[2, 3] <- 1
23+
result <- expect_silent(h_df_md_res(fit, contrast))
24+
expect_list(result)
25+
expect_identical(result$num_df, 2L)
26+
expect_identical(result$denom_df, 526L)
27+
expect_equal(result$f_stat, 36.9114, tolerance = 1e-3)
28+
expect_true(result$p_val < 1e-10)
29+
})

0 commit comments

Comments
 (0)