Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 9 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,12 @@ manifest.json
^\.github$
^cran-comments\.md$
^CRAN-SUBMISSION$
^\.claude$
^CLAUDE\.MD$
^ENHANCEMENTS\.md$
^IMPLEMENTATION_PLAN\.md$
^\.planning$
^doc$
^Meta$
^README\.Rmd$
^README\.html$
27 changes: 16 additions & 11 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: beeca
Title: Binary Endpoint Estimation with Covariate Adjustment
Version: 0.2.0
Version: 0.3.0
Authors@R:
c(person(given = "Alex",
family = "Przybylski",
Expand All @@ -24,31 +24,36 @@ Authors@R:
email = "dominic.magirr@novartis.com",
role = c("aut")
))
Description: Performs estimation of marginal treatment effects for binary
outcomes when using logistic regression working models with covariate
adjustment (see discussions in Magirr et al (2024) <https://osf.io/9mp58/>).
Implements the variance estimators of Ge et al (2011) <doi:10.1177/009286151104500409>
Description: Performs estimation of marginal treatment effects for binary
outcomes when using logistic regression working models with covariate
adjustment (see Magirr et al (2025) <doi:10.1002/pst.70021>).
Implements the variance estimators of Ge et al (2011) <doi:10.1177/009286151104500409>
and Ye et al (2023) <doi:10.1080/24754269.2023.2205802>.
Maintainer: Alex Przybylski <alexander.przybylski@novartis.com>
License: LGPL (>= 3)
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.2
Suggests:
Suggests:
cards,
ggplot2,
gt,
knitr,
rmarkdown,
testthat (>= 3.0.0),
tidyr,
marginaleffects,
margins,
RobinCar (>= 0.3.0)
RobinCar (>= 0.3.0),
rmarkdown,
testthat (>= 3.0.0),
tidyr
Config/testthat/edition: 3
Depends:
R (>= 2.10)
LazyData: true
Imports:
Imports:
dplyr,
generics,
lifecycle,
rlang,
sandwich,
stats
VignetteBuilder: knitr
Expand Down
Binary file added Meta/vignette.rds
Binary file not shown.
19 changes: 19 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,15 +1,34 @@
# Generated by roxygen2: do not edit by hand

S3method(as_gt,beeca)
S3method(as_gt,default)
S3method(augment,beeca)
S3method(plot,beeca)
S3method(print,beeca)
S3method(sanitize_model,default)
S3method(sanitize_model,glm)
S3method(summary,beeca)
S3method(tidy,beeca)
export(apply_contrast)
export(as_gt)
export(augment)
export(average_predictions)
export(beeca_fit)
export(beeca_summary_table)
export(beeca_to_cards_ard)
export(estimate_varcov)
export(format_pvalue)
export(get_marginal_effect)
export(plot_forest)
export(predict_counterfactuals)
export(sanitize_model)
export(tidy)
importFrom(dplyr,as_tibble)
importFrom(generics,augment)
importFrom(generics,tidy)
importFrom(lifecycle,deprecated)
importFrom(rlang,.data)
importFrom(stats,binomial)
importFrom(stats,cov)
importFrom(stats,model.frame)
importFrom(stats,model.matrix)
Expand Down
28 changes: 28 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
# beeca 0.3.0

## New Features

* `beeca_fit()`: Convenience function combining model fitting and marginal effect estimation in a single call.
* `plot_forest()`: Forest plots for visualizing treatment effects with customizable confidence levels and styling.
* `plot.beeca()`: S3 plot method for beeca objects.
* `beeca_summary_table()`: Generate summary tables from beeca objects returning a data frame with arm statistics and treatment effects.
* `beeca_to_cards_ard()`: Convert beeca results to Analysis Results Data format via cards.
* `tidy.beeca()`: Tidy method returning treatment effect estimates as a tibble.
* `augment.beeca()`: Augment method returning original data with fitted values and predictions.
* `print.beeca()`: Concise print output showing treatment effect, standard error, Z-value, and p-value.
* `summary.beeca()`: Comprehensive summary including marginal risks and treatment effects with confidence intervals.
* `as_gt.beeca()`: Create publication-ready gt tables from beeca objects with customizable titles and footnotes.
* `trial02_cdisc`: CDISC-compliant example dataset for clinical trial workflows.

## Improvements

* Updated Magirr et al. reference from OSF preprint to published version in Pharmaceutical Statistics (2025).
* Added `rlang` and `generics` to package Imports for robust non-standard evaluation and S3 method support.
* Added Suggests dependencies for enhanced visualization (`ggplot2`) and table formatting (`gt`, `cards`).
* Enhanced vignettes with improved narrative flow, cross-referencing, and method guidance.

## Bug Fixes

* Fixed function name conflict in `plot_forest()` where base R's `diff()` was called incorrectly.
* Replaced deprecated `geom_errorbarh()` with `geom_errorbar(orientation = "y")` in `plot_forest()` for ggplot2 4.0.0 compatibility.

# beeca 0.2.0

- Extensions to allow for more than two treatment arms in the model fit.
Expand Down
4 changes: 4 additions & 0 deletions R/apply_contrast.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,12 @@
#' These appended component provide crucial information for interpreting
#' the treatment effect using the specified contrast method.
#'
#' @seealso [predict_counterfactuals()] for generating counterfactual predictions
#' @seealso [average_predictions()] for averaging counterfactual predictions
#' @seealso [estimate_varcov()] for robust variance estimation
#' @seealso [get_marginal_effect()] for estimating marginal effects directly
#' from an original \code{\link[stats]{glm}} object
#' @seealso [beeca_fit()] for streamlined analysis pipeline
#'
#' @examples
#' trial01$trtp <- factor(trial01$trtp)
Expand Down
Loading