You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SUMM: "topic week" consolidate stats for rates and proportion #3954
I completely lost the overview.
There was a lot of discussion and work in 2015, and several more isolated items, issues and PRs since then.
If we ignore coming up with a "final" API and not try to do everything at once, then there are many relatively easy merges. Some code/functions still need to be collected that are not yet in PRs.
e.g. proportion_confint_2sample in analogue to proportion_confint and multinomial_proportions_confint
or some name similar to proportion_confint_2sample for independent samples and for paired samples.
or one single function proportion_confint with options 'one', 'paired' and 'indep'
(But for two sample we have more options also for which statistic, e.g. difference, ration, odds ratio, where some of this overlaps with 2x2 contingency tables, which don't distinguish between assumed data generating or sampling process.)
In terms of API and implementation we could go for a dual approach, simple function for easy use like proportion_confint, and the class based methods for more complex parts, e.g. permutation, bootstrap,... and all in one (test, confint and power).
current status in master:
mostly in stats.proportion, collection of function without much relationship between them
Parts, PRs, issues
...
for unit tests
(which are partially difficult to find):
#3952 DescTools and epiR #2605 PropCI
and more spread out across R packages with some references and links in issues or PRs
Stata also has a epitab subpackage with related functions, but more field specific API/terminology
ctype
a character string indicating the type of confidence interval to calculate.
Options are mean.single, mean.unpaired, mean.paired, prop.single, prop.unpaired,
prop.paired, prevalence, inc.risk, inc.rate, odds, ratio and smr.
method
a character string indicating the method to use. Where ctype = "inc.risk" or
ctype = "prevalence" options are exact, wilson and fleiss. Where ctype = "inc.rate"
options are exact and byar.
idea for summary comparing proportions in two samples
use data frame with columns
statistic, value, null-value, p-value, conf_int
diff
or
rr
possibly column for method (), or put method in footnote
() assuming default method is the same for p-value and conf_int
optionally add 1 sample statistics, but we might not have a reasonable default null-value
(unless it's pooled prop in this case, or just leave missing or nan)
prop1 | ...
prop2 | ...
Activity
josef-pkt commentedon Sep 30, 2017
extreme pooling of functionality
https://www.rdocumentation.org/packages/epiR/versions/0.9-87/topics/epi.conf
josef-pkt commentedon Sep 30, 2017
aside: two years is long enough to wait for the forest when we should be planting trees
scipy/scipy#7949 (comment)
(I love messing up methaphors :)
josef-pkt commentedon Sep 10, 2021
ztest and chisquare test should be "down graded" in favor of clear 1-sample, 2 indep samples and k indep samples functions
e.g. test_proportions_2indep has more and better option than proportion_ztest for the two sample case
#7564 (comment)
We don't have a single test_proportion function yet, that compares to proportion_confint in the one sample case.
josef-pkt commentedon Sep 10, 2021
second overview table in #6399 (comment) needs updating by adding 2-sample functions
DONE
josef-pkt commentedon Sep 13, 2021
I had to answer another question to explain how our defaults differ from R (with advertising for the two sample functions)
https://stats.stackexchange.com/questions/544480/statsmodels-tests-for-proportions-give-different-results-than-other-software/544507#544507
previous question
https://stackoverflow.com/questions/69133025/when-to-use-chisquare-or-a-simple-teste-for-proportion/69133640#69133640
(and there was another one on FtestAnovaPower parameterization and defaults)
josef-pkt commentedon Sep 15, 2021
idea for summary comparing proportions in two samples
use data frame with columns
statistic, value, null-value, p-value, conf_int
diff
or
rr
possibly column for method (), or put method in footnote
() assuming default method is the same for p-value and conf_int
optionally add 1 sample statistics, but we might not have a reasonable default null-value
(unless it's pooled prop in this case, or just leave missing or nan)
prop1 | ...
prop2 | ...