ApasScript.

Statistics

median

The median of a list, exact.

mode

The most frequent value(s) of a list, as an array.

variance

Population variance (divide by n), exact.

sampleVariance

Sample variance (divide by n - 1), exact.

stdDev

Population standard deviation, exact (a surd when needed).

sampleStdDev

Sample standard deviation (n - 1), exact.

covariance

Population covariance of two equal-length lists, exact.

correlation

Pearson correlation coefficient of two lists, exact.

percentile

The p-th percentile of a list (p from 0 to 100).

zScore

How many standard deviations x lies from the mean of the list.

dataRange

max - min of a list. (range() makes an array of whole numbers.)

fiveNumberSummary

Minimum, first quartile, median, third quartile and maximum. The quartiles are by the halves method of school courses and the SAT/ACT: Q1 is the median of the lower half, Q3 of the upper half, the middle value left out of both when the count is odd ([1, 2, ..., 8]: 2.5 and 6.5). Exact for exact data.

iqr

Interquartile range: third quartile minus first quartile, the quartiles by the halves method (as fiveNumberSummary).

binCounts

Frequency counts of a list in equal-width bins from lower to upper. (histogram() draws one.)

chiSquareTest

The chi-square goodness-of-fit test as the AP Biology equations sheet gives it: observed counts against an expected ratio (9:3:3:1 as [9, 3, 3, 1]) or the expected counts themselves. Gives expected (the counts the ratio predicts), contributions ((o - e)^2/e for each outcome), chi_square (exact when the counts are), df (outcomes minus one), p_value (the upper tail), critical_05 and critical_01 (the sheet's table: the quantile to two places), and decision_05, decision_01: reject null hypothesis when chi_square is greater than the critical value, else fail to reject null hypothesis.

tTest

One-sample t test of a mean from data. Gives t, df, p, estimate (the sample mean), se. Numerical. The alternative is "two_sided" (the default), "less" or "greater".

tTestSummary

tTest from the sample mean, standard deviation and size.

tInterval

t confidence interval for a mean from data. Gives lower, upper, estimate, margin, critical, se. The level is written 0.95, not 95.

tIntervalSummary

tInterval from the sample mean, standard deviation and size.

tTest2

Two-sample t test of mean1 - mean2 from data: Welch's, no equal variances assumed, with Satterthwaite's df (not rounded). Gives t, df, p, estimate, se.

tTest2Summary

tTest2 from each sample's mean, standard deviation and size.

tInterval2

Welch's confidence interval for mean1 - mean2 from data.

tInterval2Summary

tInterval2 from each sample's mean, standard deviation and size.

tTestPaired

Paired t test: the one-sample test of the differences data1 - data2 against 0.

tIntervalPaired

t confidence interval for the mean of the differences data1 - data2.

zTestProportion

One-proportion z test, x successes in n against p0, the standard error from p0. Gives z, p, estimate, se. Numerical.

zIntervalProportion

One-proportion z interval, the standard error from the sample proportion.

zTest2Proportions

Two-proportion z test of p1 - p2, the standard error from the pooled proportion.

zInterval2Proportions

Two-proportion z interval for p1 - p2, the standard error from the two separate proportions (not pooled).

chiSquareTable

Chi-square test of a table of counts, the test of independence and of homogeneity being this one computation, with no continuity correction. Gives chi_square, df, p, expected (a matrix). For goodness of fit use chiSquareTest.

oneWayAnova

One-way analysis of variance of a list of groups. Gives f, p, df_between, df_within, ss_between, ss_within, ms_between, ms_within. Numerical.

slopeTest

The t test of a regression slope against 0. Gives t, df (n - 2), p, slope, intercept, se, s, r_squared, residuals. A perfect fit is refused: it has no standard error.

slopeInterval

The t confidence interval for a regression slope.