Added optimal conditional error function design support#93
Open
morten-dreher wants to merge 27 commits intorpact-com:dev/optimalfrom
Open
Added optimal conditional error function design support#93morten-dreher wants to merge 27 commits intorpact-com:dev/optimalfrom
morten-dreher wants to merge 27 commits intorpact-com:dev/optimalfrom
Conversation
Provides print(), plot() and summary() functions for objects of class TrialDesignOptimalConditionalError
Parameters that are unique to the optimal conditional error design function suite have the "OCEF" suffix in their names. Some trailing spaces removed by styling
This is an interim solution as the original power results class will not be implemented
The conditional power effect can still be specified on the non-centrality parameter scale as before, but this is now a hidden feature and package documentation no longer describes this behaviour
Formerly incorrect @template tags now replaced with @inheritParams
Formerly incorrect @template now replaced by @inheritParams
…elated decision logic Designs with constraints now always use basic integration. Added an option to enforce basic integration.
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds comprehensive support for optimal conditional error function designs to a statistical package. The optimal conditional error function approach allows for adaptive sample size re-estimation in clinical trials while maintaining strict type I error control.
Key changes include:
- Implementation of a complete design framework for optimal conditional error functions with various likelihood ratio distributions
- Addition of utility functions for calculating conditional errors, second-stage information, and overall power
- Comprehensive test suite covering different scenarios and edge cases
Reviewed Changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/testthat/test-*.R | Six new test files providing comprehensive coverage of the optimal conditional error functionality |
| tests/testthat/.gitignore | Removes exclusion of R test files to include the new tests |
| R/parameter_descriptions.R | Adds extensive parameter documentation for the optimal conditional error design functions |
| R/f_design_optimal_utilities.R | Implements print, plot, and summary methods for the optimal conditional error design class |
| R/f_design_optimal_user.R | Provides main user-facing functions for creating designs and calculating key metrics |
| R/f_design_optimal_background.R | Contains internal helper functions for calculations and mathematical operations |
| R/class_design_optimal.R | Defines the R6 class structure for optimal conditional error trial designs |
Comments suppressed due to low confidence (1)
R/f_design_optimal_background.R:353
- In the mathematical formula comment above, there's an inconsistency. The formula shows \kappa but the variable name is \eta. The code uses 'nonCentralityParameter' which corresponds to \eta, so the formula comment should use \eta consistently.
#' \deqn{l(p_1) = \eta \cdot \sqrt{2\pi} \cdot e^{(\Phi^{-1}(1-p_1)-\eta)^2/2} \cdot \Phi(\Phi^{-1}(1-p_1)-\eta)}
| #' @keywords internal | ||
| NULL | ||
|
|
||
| #' Parameter Description: Monotonisation argument (optimal conditional error design)) |
There was a problem hiding this comment.
There is an extra closing parenthesis at the end of the comment line.
Suggested change
| #' Parameter Description: Monotonisation argument (optimal conditional error design)) | |
| #' Parameter Description: Monotonisation argument (optimal conditional error design) |
Author
|
@fpahlke Finished integration of Copilot comments, code ready for review |
Fixed two bugs that resulted in the value of the interim estimate being calculated incorrectly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.