Skip to content

ENH: one observation t-test against reference sample #2847

Open

Description

@josef-pkt

http://stackoverflow.com/questions/35788140/scipy-stats-ttest-1samp-hypothesis-testing-for-comparing-previous-performance-to

two sample t-test where one sample has only one point, i.e. is one additional point consistent with the previous sample.

I read some articles in medical statistics about this. I don't remember anything.
I think the point was not to include the new observation in calculating the variance and mean.

(sounds similar to outlier test)

would be good to add, or have a ready example if something else can be reused for it.

Activity

  1. josef-pkt commented on Sep 23, 2016

    @josef-pkt
    MemberAuthor

    see #3199 for related multivariate case

    a reference I found by same authors as multivariate case

    Crawford, John R., and Paul H. Garthwaite. 2012. “Single-Case Research in Neuropsychology: A Comparison of Five Forms of T-Test for Comparing a Case to Controls.” Cortex 48 (8): 1009–16. doi:10.1016/j.cortex.2011.06.021.

    (main comment: verbose, written for practitioner audience)

    there are others, (that I'm not reading now), like

    Crawford, John R., Paul H. Garthwaite, and Kevin Ryan. 2011. “Comparing a Single Case to a Control Sample: Testing for Neuropsychological Deficits and Dissociations in the Presence of Covariates.” Cortex 47 (10): 1166–78. doi:10.1016/j.cortex.2011.02.017.

  2. josef-pkt commented on Dec 1, 2016

    @josef-pkt
    MemberAuthor

    bump

    something like (assuming var of a single observation is 1, nobs1=100, nobs2=1)
    We assume variance of an observation is from the first sample and not the pooled sample, because the second sample could come from a different population or be an outlier.

    >>> import statsmodels.stats.weightstats as smw
    >>> smw._tstat_generic(8, 5, 1/(1/100 + 1), 5, '2s')
    (3.0300000000000002, 0.029081429741467726)
    

    I'm not sure I remember the variance formula correctly without looking it up.
    It would be more convenient (require less thinking) if we could specify two var instead of var_diff in the two generic tstat and zstat tests.

    related case: The second sample is small, not necessarily a single case, and we want to use the variance of the reference sample. However, we still need to correct that the means are based on different sample sizes.
    (while thinking/reading about control charts, which traditionally did not take parameter uncertainty into account)

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