Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

79 add binary endpoints to wrapper anchored function #112

Merged
merged 42 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
01cbf8b
add binary-helper.R
hoppanda Mar 15, 2024
f42919c
tempo update
hoppanda Mar 15, 2024
b57bcd3
update
hoppanda Mar 15, 2024
6c01591
reformat as anchored wrapper function and add in binary initial script
hoppanda Apr 12, 2024
e0bcd19
separate binary inferential part to a separate function
hoppanda Apr 12, 2024
4053945
refine binary inferential function
hoppanda Apr 12, 2024
dc73d8f
Merge pull request #91 from hta-pharma/67-add-function-to-expand-2x2-…
hoppanda Apr 19, 2024
d2ce708
workable binary unanchor
hoppanda May 2, 2024
818cc53
add unanchored binary example
hoppanda May 2, 2024
0135d0f
keep consistency of treatment column name between binary and tte usin…
hoppanda May 2, 2024
cd699ff
make binary bootstrap work with cli progress bar
hoppanda May 2, 2024
467327c
styler
hoppanda May 2, 2024
45cbd9a
update unanchor binary example annotation
hoppanda May 2, 2024
211f6d9
add test for binary helper function
hoppanda May 2, 2024
931d83e
add test for binary unanchored MAIC wrapper
hoppanda May 2, 2024
433ebb8
add boot quantile function, and test for tte unanchor maic wrapper
hoppanda May 3, 2024
095f857
update document
hoppanda May 3, 2024
04bd382
deactive unnecessary line in testthat
hoppanda May 3, 2024
9e3b34d
update anchored tte given new report function and add bootstrap quant…
hoppanda May 3, 2024
24cf75d
add binary
hoppanda May 3, 2024
cb6958c
update
hoppanda May 3, 2024
51ca57b
update print of maicplus bucher object and add reformat object
hoppanda May 3, 2024
e425511
Merge branch '79-add-binary-endpoints-to-wrapper-anchored-function' i…
hoppanda Jun 27, 2024
bf5b761
Merge pull request #107 from hta-pharma/update-with-bootstrap-code
hoppanda Jun 27, 2024
9ca4431
Merge branch '79-add-binary-endpoints-to-wrapper-anchored-function' i…
hoppanda Jun 27, 2024
5e1d770
Merge pull request #110 from hta-pharma/update-to-main
hoppanda Jun 27, 2024
1bf9b9b
update
hoppanda Jun 28, 2024
a30ae81
[skip style] [skip vbump] Restyle files
github-actions[bot] Jun 28, 2024
4d53b72
[skip roxygen] [skip vbump] Roxygen Man Pages Auto Update
dependabot-preview[bot] Jun 28, 2024
cbc1934
Apply suggestions from code review
gravesti Jul 12, 2024
b35388d
[skip roxygen] [skip vbump] Roxygen Man Pages Auto Update
dependabot-preview[bot] Jul 12, 2024
2bfa8b8
add example
gravesti Jul 12, 2024
a49eec5
adapt test
gravesti Jul 12, 2024
eb3b44f
Merge branch '79-add-binary-endpoints-to-wrapper-anchored-function' o…
gravesti Jul 12, 2024
ab2acef
[skip style] [skip vbump] Restyle files
github-actions[bot] Jul 12, 2024
47b4040
Merge branch 'main' into 79-add-binary-endpoints-to-wrapper-anchored-…
gravesti Jul 12, 2024
5738083
update example with new data
gravesti Jul 12, 2024
5df9cef
update data
gravesti Jul 18, 2024
fd2a58a
add test
gravesti Jul 18, 2024
c2896eb
correctly report adjusted A v C
gravesti Jul 18, 2024
0824ad0
update test again
gravesti Jul 18, 2024
d398b9b
Merge branch 'main' into 79-add-binary-endpoints-to-wrapper-anchored-…
gravesti Jul 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ repos:
- lubridate
- DescTools
- lmtest
- sandwich
# codemeta must be above use-tidy-description when both are used
# - id: codemeta-description-updated
- id: use-tidy-description
Expand Down Expand Up @@ -50,6 +51,11 @@ repos:
- id: parsable-R
- id: no-browser-statement
- id: deps-in-desc
exclude: >
(?x)^(
data-raw/.*|
(.*/|)\.Rprofile
)$
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
hooks:
Expand Down
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ Imports:
MASS,
boot,
stringr,
lmtest
lmtest,
sandwich
Suggests:
knitr,
testthat (>= 2.0),
ggplot2,
rmarkdown,
dplyr,
sandwich,
survminer,
flexsurv,
tibble,
Expand Down
4 changes: 4 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,14 @@ import(lubridate)
import(stats)
import(stringr)
import(survival)
importFrom(boot,boot)
importFrom(boot,boot.ci)
importFrom(grDevices,col2rgb)
importFrom(grDevices,rgb)
importFrom(lmtest,coefci)
importFrom(lmtest,coeftest)
importFrom(sandwich,vcovHC)
importFrom(survival,Surv)
importFrom(survival,coxph)
importFrom(survival,survfit)
importFrom(utils,stack)
35 changes: 32 additions & 3 deletions R/bucher.R
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,32 @@ find_SE_from_CI <- function(CI_lower = NULL, CI_upper = NULL,

print.maicplus_bucher <- function(x, ci_digits = 2, pval_digits = 3,
exponentiate = FALSE, ...) {
output <- reformat(x, ci_digits, pval_digits,
show_pval = TRUE, exponentiate
)
print(output)
}

#' Reformat `maicplus_bucher` alike object
#'
#' @param x a list, structured like a `maicplus_bucher` object
#' @param ci_digits an integer, number of decimal places for point
#' estimate and derived confidence limits
#' @param pval_digits an integer, number of decimal places to display
#' Z-test p-value
#' @param show_pval a logical value, default is TRUE. If FALSE, p-value will not
#' be output as the second element of the character vector
#' @param exponentiate whether the treatment effect and confidence
#' interval should be exponentiated. This applies to relative
#' treatment effects. Default is set to false.


reformat <- function(x, ci_digits = 2, pval_digits = 3,
show_pval = TRUE, exponentiate = FALSE) {
transform_this <- function(x) {
ifelse(exponentiate, exp(x), x)
}

a <- format(round(transform_this(x$est), ci_digits),
nsmall = ci_digits
)
Expand All @@ -156,7 +179,13 @@ print.maicplus_bucher <- function(x, ci_digits = 2, pval_digits = 3,
format(disp_pval, nsmall = pval_digits)
)

output <- c(res, disp_pval)
names(output) <- c("result", "pvalue")
print(output)
if (show_pval) {
output <- c(res, disp_pval)
names(output) <- c("result", "pvalue")
} else {
output <- res
names(output) <- "result"
}

output
}
Loading
Loading