-
Notifications
You must be signed in to change notification settings - Fork 88
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
Add Constructor to FisherExactTest #156
base: master
Are you sure you want to change the base?
Changes from 2 commits
3492754
037a393
87905cb
ce7d35a
150cda6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -26,11 +26,15 @@ export FisherExactTest | |||||
|
||||||
""" | ||||||
FisherExactTest(a::Integer, b::Integer, c::Integer, d::Integer) | ||||||
FisherExactTest(x) | ||||||
|
||||||
Perform Fisher's exact test of the null hypothesis that the success probabilities ``a/c`` | ||||||
and ``b/d`` are equal, that is the odds ratio ``(a/c) / (b/d)`` is one, against the | ||||||
alternative hypothesis that they are not equal. | ||||||
|
||||||
If `x` is a matrix with at least two rows and columns, it is taken as a two-dimensional | ||||||
contingency table. | ||||||
|
||||||
See [`pvalue(::FisherExactTest)`](@ref) and [`confint(::FisherExactTest)`](@ref) for details | ||||||
about the computation of the default p-value and confidence interval, respectively. | ||||||
|
||||||
|
@@ -41,10 +45,11 @@ The contingency table is structured as: | |||||
|*Y1*| a | b | | ||||||
|*Y2*| c | d | | ||||||
|
||||||
!!! note | ||||||
!!! Note: | ||||||
The `show` function output contains the conditional maximum likelihood estimate of the | ||||||
odds ratio rather than the sample odds ratio; it maximizes the likelihood given by | ||||||
Fisher's non-central hypergeometric distribution. | ||||||
The entries must be non-negative integers. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Say this in the sentence about contingency table rather than in this note, which is about something else. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I made all the suggested changes. |
||||||
|
||||||
Implements: [`pvalue(::FisherExactTest)`](@ref), [`confint(::FisherExactTest)`](@ref) | ||||||
|
||||||
|
@@ -73,6 +78,10 @@ struct FisherExactTest <: HypothesisTest | |||||
end | ||||||
end | ||||||
|
||||||
function FisherExactTest(x::AbstractMatrix{T}) where T<:Integer | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
FisherExactTest(x[1,1], x[1,2], x[2,1], x[2,2]) | ||||||
end | ||||||
|
||||||
testname(::FisherExactTest) = "Fisher's exact test" | ||||||
population_param_of_interest(x::FisherExactTest) = ("Odds ratio", 1.0, x.ω) # parameter of interest: name, value under h0, point estimate | ||||||
default_tail(test::FisherExactTest) = :both | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is syntax, not text, so please keep it as-is.