Skip to content

Conversation

@PharmCat
Copy link
Contributor

Implementation for Superiority/Non-Inferiority, Equivalence, Equality interval hypothesis for proportion difference, odd ratio, risk ratio, issue #217.
Need review or/and validation.
Structures are discussible.

Copy link
Member

@nalimilan nalimilan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, and sorry for the delay in reviewing! This is an impressive PR. Would you still be interested in finishing this? I imagine this code is currently in use in ClinicalTrialUtilities.jl, right?

I have made mostly formal comments, I think the main work that remains to do is to integrate with the pattern used for all tests across the package, but it shouldn't be too hard.

@@ -0,0 +1,541 @@
# twobinomial.jl
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better put this in binomial.jl? This seems to be the pattern we use for other tests.

Comment on lines +65 to +68
Hypothesis type `htype` are:
- `:equality`
- `:equivalence`
- `:superiority`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this relate to/differ from the tail argument that is supported by existing tests?

- `:riskratio` : risk ratio;
- `:oddratio` : odd ratio;

For each parameters can be used following methods.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The convention we use is to spell author names in full, separated with underscores. Also, can you describe each method and ensure consistency with BinomialTest when applicable? You can take inspiration from its docstring.


export TwoSampleBinomialTest

struct TwoSampleBinomialTask
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the advantage of storing this in a separate struct? I'd rather store these fields directly in TwoSampleBinomialTest.

@@ -0,0 +1,88 @@
using HypothesisTests, Test

@testset "Two Binomial" begin
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you checked all the values hardcoded here against other publications or software? Given the number of methods and special cases for each of them, I imagine these tests don't cover all branches, do they?

end
################################################################################
function ci_diff(test; level, method)
if method == :mn || method == :default
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better drop :default and use :mn everywhere. Though for the current BinomialTest we use Clopper-Pearson as the default. Can we be consistent with that choice here?

"""
TwoSampleBinomialTest(x1::Real, n1::Real, x2::Real, n2::Real, δ::Real; ptype::Symbol, htype::Symbol, alpha::Real = 0.05, method::Symbol = :default)

Perform a two sample binomial hypothesis check via computing confidence intrval
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also mention the meaning of each argument.

@PharmCat
Copy link
Contributor Author

Thanks, and sorry for the delay in reviewing! This is an impressive PR. Would you still be interested in finishing this?

Thank you for reply and for all comments! :) Yes, I still interested in it, an I think I finish it, but it can take some time.

I imagine this code is currently in use in ClinicalTrialUtilities.jl, right?

Yes, idea was to include code to HypothesisTests and use it from CTU and other packages. In some parts code is more optimized and was rethinked from last time.

PharmCat and others added 8 commits June 10, 2022 03:29
Co-authored-by: Milan Bouchet-Valat <nalimilan@club.fr>
Co-authored-by: Milan Bouchet-Valat <nalimilan@club.fr>
Co-authored-by: Milan Bouchet-Valat <nalimilan@club.fr>
Co-authored-by: Milan Bouchet-Valat <nalimilan@club.fr>
Co-authored-by: Milan Bouchet-Valat <nalimilan@club.fr>
Co-authored-by: Milan Bouchet-Valat <nalimilan@club.fr>
Co-authored-by: Milan Bouchet-Valat <nalimilan@club.fr>
@codecov-commenter
Copy link

codecov-commenter commented Jun 10, 2022

Codecov Report

❗ No coverage uploaded for pull request base (master@e11d673). Click here to learn what that means.
The diff coverage is n/a.

❗ Current head c75381f differs from pull request most recent head be4ff57. Consider uploading reports for the commit be4ff57 to get more accurate results

@@            Coverage Diff            @@
##             master     #218   +/-   ##
=========================================
  Coverage          ?   92.82%           
=========================================
  Files             ?       29           
  Lines             ?     2064           
  Branches          ?        0           
=========================================
  Hits              ?     1916           
  Misses            ?      148           
  Partials          ?        0           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e11d673...be4ff57. Read the comment docs.

@PharmCat
Copy link
Contributor Author

try to make it step be step

@PharmCat PharmCat closed this Apr 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants