Skip to content

Commit dd721c1

Browse files
committed
DOC: added example to stats.f_oneway.
1 parent adfceca commit dd721c1

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

scipy/stats/stats.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2687,6 +2687,30 @@ def f_oneway(*args):
26872687
26882688
.. [2] Heiman, G.W. Research Methods in Statistics. 2002.
26892689
2690+
.. [3] McDonald, G. H. "Handbook of Biological Statistics", One-way ANOVA.
2691+
http://http://www.biostathandbook.com/onewayanova.html
2692+
2693+
Examples
2694+
--------
2695+
>>> import scipy.stats as stats
2696+
2697+
[3]_ Here are some data on a shell measurement (the length of the anterior
2698+
adductor muscle scar, standardized by dividing by length) in the mussel
2699+
Mytilus trossulus from five locations: Tillamook, Oregon; Newport, Oregon;
2700+
Petersburg, Alaska; Magadan, Russia; and Tvarminne, Finland, taken from a
2701+
much larger data set used in McDonald et al. (1991).
2702+
2703+
>>> tillamook = [0.0571, 0.0813, 0.0831, 0.0976, 0.0817, 0.0859, 0.0735,
2704+
... 0.0659, 0.0923, 0.0836]
2705+
>>> newport = [0.0873, 0.0662, 0.0672, 0.0819, 0.0749, 0.0649, 0.0835,
2706+
... 0.0725]
2707+
>>> petersburg = [0.0974, 0.1352, 0.0817, 0.1016, 0.0968, 0.1064, 0.105]
2708+
>>> magadan = [0.1033, 0.0915, 0.0781, 0.0685, 0.0677, 0.0697, 0.0764,
2709+
... 0.0689]
2710+
>>> tvarminne = [0.0703, 0.1026, 0.0956, 0.0973, 0.1039, 0.1045]
2711+
>>> stats.f_oneway(tillamook, newport, petersburg, magadan, tvarminne)
2712+
F_onewayResult(statistic=7.1210194716424473, pvalue=0.00028122423145345439)
2713+
26902714
"""
26912715
args = [np.asarray(arg, dtype=float) for arg in args]
26922716
# ANOVA on N groups, each in its own array

0 commit comments

Comments
 (0)