psychopy_ext.stats.confidence

psychopy_ext.stats.confidence(agg, kind='sem', within=None, alpha=0.05, nsamples=None, skipna=True)[source]

Compute confidence of measurements, such as standard error of means (SEM) or confidence intervals (CI).

Args:

agg

Kwargs:
  • kind (‘sem’, ‘ci’, or ‘binomial’, default: ‘sem’)

    Warning

    Binomial not tested throroughly

  • within (str or list, default: None)

    For repeated measures designs, error bars are too large. Specify which dimensions come from repeated measures (rows, cols, and/or subplots). It computes within-subject confidence intervals using a method by Loftus & Masson (1994) simplified by Cousinaueu (2005) with Morey’s (2008) correction. Based on Denis A. Engemann’s gist

  • alpha (float, default: .05)

    For CI and binomial. Computed for single-tail, so effectively alpha/2.

  • nsamples

    For binomial distribution confidence intervals if there is a single sample only (which presumably relfects the number of correct responses, i.e., successes). See Wikipedia

  • skipna (default: True)

    Whether to skip NA / null values or not.

    Warning

    Not tested thoroughly

Returns:

mean, p_yerr