Skip to content

SUMM: "topic week" consolidate stats for rates and proportion #3954

Open

Description

@josef-pkt

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

Activity

  1. josef-pkt commented on Sep 30, 2017

    @josef-pkt
    MemberAuthor

    extreme pooling of functionality
    https://www.rdocumentation.org/packages/epiR/versions/0.9-87/topics/epi.conf

    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.
    
  2. josef-pkt commented on Sep 30, 2017

    @josef-pkt
    MemberAuthor

    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 :)

  3. josef-pkt commented on Sep 10, 2021

    @josef-pkt
    MemberAuthor

    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.

  4. josef-pkt commented on Sep 10, 2021

    @josef-pkt
    MemberAuthor

    second overview table in #6399 (comment) needs updating by adding 2-sample functions
    DONE

  5. josef-pkt commented on Sep 13, 2021

    @josef-pkt
    MemberAuthor
  6. josef-pkt commented on Sep 15, 2021

    @josef-pkt
    MemberAuthor

    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 | ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions