Skip to content

Commit

Permalink
CRAN release v0.1.1 [skip vbump] (#45)
Browse files Browse the repository at this point in the history
Closes #44 #39

---------

Co-authored-by: shajoezhu <sha.joe.zhu@gmail.com>
  • Loading branch information
edelarua and shajoezhu authored Dec 8, 2023
1 parent 1b9e628 commit 91cb92a
Show file tree
Hide file tree
Showing 8 changed files with 78 additions and 68 deletions.
Empty file modified .pre-commit-config.yaml
100644 → 100755
Empty file.
10 changes: 4 additions & 6 deletions DESCRIPTION
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Type: Package
Package: tern.gee
Title: Tables and Graphs for Generalized Estimating Equations (GEE) Model
Fits
Version: 0.1.0.9009
Version: 0.1.1
Date: 2023-11-28
Authors@R: c(
person("Daniel", "Sabanés Bové", , "daniel.sabanes_bove@roche.com", role = c("aut", "cre")),
Expand All @@ -16,15 +16,15 @@ URL: https://github.com/insightsengineering/tern.gee/
BugReports: https://github.com/insightsengineering/tern.gee/issues
Depends:
R (>= 4.0),
tern (>= 0.7.10)
tern (>= 0.9.3)
Imports:
checkmate,
emmeans (>= 1.4.5),
formatters,
formatters (>= 0.5.5),
geeasy,
geepack,
nlme,
rtables,
rtables (>= 0.6.6),
stats
Suggests:
dplyr,
Expand All @@ -34,8 +34,6 @@ Suggests:
vdiffr
VignetteBuilder:
knitr
Remotes:
insightsengineering/tern@*release
Config/testthat/edition: 3
Encoding: UTF-8
Language: en-US
Expand Down
14 changes: 5 additions & 9 deletions NEWS.md
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
# tern.gee 0.1.0.9009
# tern.gee 0.1.1

### Miscellaneous

* Add badges to README.
* Added badges to README.

# tern.gee 0.1.0

### Enhancements

* First release
* Update pkgdown site, introduction vignette, and README, add unit tests.
* Add examples for `fit_gee`, `lsmeans`, `s_lsmeans_logistic`, `summarize_gee_logistic`.
* First release.
* Updated pkgdown site, introduction vignette, and README, added unit tests.
* Added examples for `fit_gee`, `lsmeans`, `s_lsmeans_logistic`, `summarize_gee_logistic`.
Empty file modified R/data.R
100644 → 100755
Empty file.
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,20 @@ However if you use another reporting framework then it will be better to directl

## Installation

### GitHub
`tern.gee` is available on CRAN and you can install the latest released version with:

It is recommended that you [create and use a Github PAT](https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token) to install the latest version of this package. Once you have the PAT, run the following:
``` r
install.packages("tern.gee")
```

```r
Sys.setenv(GITHUB_PAT = "your_access_token_here")
or you can install the latest development version directly from GitHub by running the following:

``` r
if (!require("remotes")) install.packages("remotes")
remotes::install_github("insightsengineering/tern.gee@*release")
remotes::install_github("insightsengineering/tern.gee")
```

### `NEST` distribution

A stable release of all `NEST` packages is also available [here](https://github.com/insightsengineering/depository#readme).
Note that it is recommended you [create and use a `GITHUB_PAT`](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) if installing from GitHub.

## Getting started

Expand Down
Empty file modified man/fev_data.Rd
100644 → 100755
Empty file.
44 changes: 44 additions & 0 deletions tests/testthat/_snaps/tabulate_gee.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# h_gee_cov works as expected

Code
result
Output
VIS1 VIS2 VIS3 VIS4
————————————————————————————————————————————
VIS1 1.0000 -0.0565 -0.1257 0.0678
VIS2 -0.0565 1.0000 -0.0836 -0.0578
VIS3 -0.1257 -0.0836 1.0000 0.0092
VIS4 0.0678 -0.0578 0.0092 1.0000

# summarize_gee_logistic works as expected with covariates in the model

Code
result
Output
PBO TRT
(N=105) (N=95)
———————————————————————————————————————————————————————————
n 420 380
Adjusted Mean Proportion (SE) 0.90 (0.02) 0.95 (0.01)
95% CI (0.85, 0.93) (0.91, 0.97)
Odds Ratio 1.97
95% CI (1.03, 3.77)
Log Odds Ratio 0.68
95% CI (0.03, 1.33)

# summarize_gee_logistic works as expected with no covariates in the model

Code
result
Output
PBO TRT
(N=105) (N=95)
———————————————————————————————————————————————————————————
n 420 380
Adjusted Mean Proportion (SE) 0.88 (0.02) 0.94 (0.01)
95% CI (0.84, 0.92) (0.91, 0.97)
Odds Ratio 2.18
95% CI (1.16, 4.10)
Log Odds Ratio 0.78
95% CI (0.15, 1.41)

61 changes: 16 additions & 45 deletions tests/testthat/test-tabulate_gee.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,26 @@ model <- fit_gee(
)

# to do: finish test once h_gee_coef is working correctly
test_that("h_gee_coef works as expected", {
# result <- expect_silent(h_gee_coef(model))
# result2 <- as.rtable(model, type = "coef", format = "xx.xxxx")
# expect_identical(result, result2)
#
# result_matrix <- to_string_matrix(result)
# expected_matrix <- structure(
# c(
# ),
# dim = c()
# )
# expect_identical(result_matrix, expected_matrix)
})
# test_that("h_gee_coef works as expected", {
# result <- expect_silent(h_gee_coef(model))
# result2 <- as.rtable(model, type = "coef", format = "xx.xxxx")
# expect_identical(result, result2)
#
# result_matrix <- to_string_matrix(result)
# expected_matrix <- structure(
# c(
# ),
# dim = c()
# )
# expect_identical(result_matrix, expected_matrix)
# })

test_that("h_gee_cov works as expected", {
result <- expect_silent(h_gee_cov(model))
result2 <- as.rtable(model, type = "cov", format = "xx.xxxx")
expect_identical(result, result2)

result_matrix <- to_string_matrix(result)
expected_matrix <- structure(
c(
"", "VIS1", "VIS2", "VIS3", "VIS4",
"VIS1", "1.0000", "-0.0565", "-0.1257", "0.0678",
"VIS2", "-0.0565", "1.0000", "-0.0836", "-0.0578",
"VIS3", "-0.1257", "-0.0836", "1.0000", "0.0092",
"VIS4", "0.0678", "-0.0578", "0.0092", "1.0000"
),
dim = c(5L, 5L)
)
expect_identical(result_matrix, expected_matrix)
expect_snapshot(result)
})

test_that("s_lsmeans_logistic works as expected when not in reference column", {
Expand Down Expand Up @@ -81,16 +70,7 @@ test_that("summarize_gee_logistic works as expected with covariates in the model
alt_counts_df = dat_adsl
)

result_matrix <- to_string_matrix(result)
expected_matrix <- structure(
c(
"", "", "n", "Adjusted Mean Proportion (SE)", "95% CI", "Odds Ratio", "95% CI", "Log Odds Ratio", "95% CI",
"PBO", "(N=105)", "420", "0.90 (0.02)", "(0.85, 0.93)", "", "", "", "",
"TRT", "(N=95)", "380", "0.95 (0.01)", "(0.91, 0.97)", "1.97", "(1.03, 3.77)", "0.68", "(0.03, 1.33)"
),
dim = c(9L, 3L)
)
expect_identical(result_matrix, expected_matrix)
expect_snapshot(result)
})

test_that("summarize_gee_logistic works as expected with no covariates in the model", {
Expand All @@ -115,14 +95,5 @@ test_that("summarize_gee_logistic works as expected with no covariates in the mo
alt_counts_df = dat_adsl
)

result_matrix <- to_string_matrix(result)
expected_matrix <- structure(
c(
"", "", "n", "Adjusted Mean Proportion (SE)", "95% CI", "Odds Ratio", "95% CI", "Log Odds Ratio", "95% CI",
"PBO", "(N=105)", "420", "0.88 (0.02)", "(0.84, 0.92)", "", "", "", "",
"TRT", "(N=95)", "380", "0.94 (0.01)", "(0.91, 0.97)", "2.18", "(1.16, 4.10)", "0.78", "(0.15, 1.41)"
),
dim = c(9L, 3L)
)
expect_identical(result_matrix, expected_matrix)
expect_snapshot(result)
})

0 comments on commit 91cb92a

Please sign in to comment.