66# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
77# copies of the Software, and to permit persons to whom the Software is
88# furnished to do so, subject to the following conditions:
9- #
9+ #
1010# The above copyright notice and this permission notice shall be included in
1111# all copies or substantial portions of the Software.
12- #
12+ #
1313# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1414# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1515# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2020#
2121# Comments and/or additions are welcome (send e-mail to:
222223- #
23+ #
2424"""
2525stats.py module
2626
134134 ksprob
135135 fprob
136136 betacf
137- gammln
137+ gammln
138138 betai
139139
140140ANOVA FUNCTIONS: F_oneway
@@ -960,7 +960,7 @@ def lkendalltau(x, y):
960960
961961def llinregress (x , y ):
962962 """
963- Calculates a regression line on x,y pairs.
963+ Calculates a regression line on x,y pairs.
964964
965965Usage: llinregress(x,y) x,y are equal-length lists of x-y coordinates
966966Returns: slope, intercept, r, two-tailed prob, sterr-of-estimate
@@ -1255,7 +1255,7 @@ def lkruskalwallish(*args):
12551255The Kruskal-Wallis H-test is a non-parametric ANOVA for 3 or more
12561256groups, requiring at least 5 subjects in each group. This function
12571257calculates the Kruskal-Wallis H-test for 3 or more independent samples
1258- and returns the result.
1258+ and returns the result.
12591259
12601260Usage: lkruskalwallish(*args)
12611261Returns: H-statistic (corrected for ties), associated p-value
@@ -1394,7 +1394,7 @@ def lerfcc(x):
13941394def lzprob (z ):
13951395 """
13961396Returns the area under the normal curve 'to the left of' the given z value.
1397- Thus,
1397+ Thus,
13981398 for z<0, zprob(z) = 1-tail probability
13991399 for z>0, 1.0-zprob(z) = 1-tail probability
14001400 for any z, 2.0*(1.0-zprob(abs(z))) = 2-tail probability
@@ -1847,7 +1847,7 @@ def lfindwithin (data):
18471847Returns an integer representing a binary vector, where 1=within-
18481848subject factor, 0=between. Input equals the entire data 2D list (i.e.,
18491849column 0=random factor, column -1=measured values (those two are skipped).
1850- Note: input data is in |Stat format ... a list of lists ("2D list") with
1850+ Note: input data is in |Stat format ... a list of lists ("2D list") with
18511851one row per measured value, first column=subject identifier, last column=
18521852score, one in-between column per factor (these columns contain level
18531853designations on each factor). See also stats.anova.__doc__.
@@ -2234,7 +2234,7 @@ def atmean(a,limits=None,inclusive=(1, 1)):
22342234 def atvar (a ,limits = None ,inclusive = (1 , 1 )):
22352235 """
22362236Returns the sample variance of values in an array, (i.e., using N-1),
2237- ignoring values strictly outside the sequence passed to 'limits'.
2237+ ignoring values strictly outside the sequence passed to 'limits'.
22382238Note: either limit in the sequence, or the value of limits itself,
22392239can be set to None. The inclusive list/tuple determines whether the lower
22402240and upper limiting bounds (respectively) are open/exclusive (0) or
@@ -2387,8 +2387,8 @@ def avariation(a,dimension=None):
23872387 return 100.0 * asamplestdev (a , dimension )/ amean (a , dimension )
23882388
23892389
2390- def askew (a ,dimension = None ):
2391- """
2390+ def askew (a ,dimension = None ):
2391+ """
23922392Returns the skewness of a distribution (normal ==> 0.0; >0 means extra
23932393weight in left tail). Use askewtest() to see if it's close enough.
23942394Dimension can equal None (ravel array first), an integer (the
@@ -2704,7 +2704,7 @@ def asamplevar (inarray,dimension=None,keepdims=0):
27042704 mn = amean (inarray , dimension )[:, N .NewAxis ]
27052705 else :
27062706 mn = amean (inarray , dimension , keepdims = 1 )
2707- deviations = inarray - mn
2707+ deviations = inarray - mn
27082708 if isinstance (dimension , list ):
27092709 n = 1
27102710 for d in dimension :
@@ -3357,7 +3357,7 @@ def attest_ind (a, b, dimension=None, printit=0, name1='Samp1', name2='Samp2',wr
33573357 probs = N .reshape (probs , t .shape )
33583358 if probs .shape == (1 ,):
33593359 probs = probs [0 ]
3360-
3360+
33613361 if printit != 0 :
33623362 if isinstance (t , N .ndarray ):
33633363 t = t [0 ]
@@ -3782,7 +3782,7 @@ def aerfcc(x):
37823782 def azprob (z ):
37833783 """
37843784Returns the area under the normal curve 'to the left of' the given z value.
3785- Thus,
3785+ Thus,
37863786 for z<0, zprob(z) = 1-tail probability
37873787 for z>0, 1.0-zprob(z) = 1-tail probability
37883788 for any z, 2.0*(1.0-zprob(abs(z))) = 2-tail probability
@@ -4373,7 +4373,7 @@ def afindwithin(data):
43734373 (acumfreq , (N .ndarray ,)) )
43744374 relfreq = Dispatch ( (lrelfreq , (list , tuple )),
43754375 (arelfreq , (N .ndarray ,)) )
4376-
4376+
43774377## VARIABILITY:
43784378 obrientransform = Dispatch ( (lobrientransform , (list , tuple )),
43794379 (aobrientransform , (N .ndarray ,)) )
@@ -4394,14 +4394,14 @@ def afindwithin(data):
43944394 (az , (N .ndarray ,)) )
43954395 zs = Dispatch ( (lzs , (list , tuple )),
43964396 (azs , (N .ndarray ,)) )
4397-
4397+
43984398## TRIMMING FCNS:
43994399 threshold = Dispatch ( (athreshold , (N .ndarray ,)),)
44004400 trimboth = Dispatch ( (ltrimboth , (list , tuple )),
44014401 (atrimboth , (N .ndarray ,)) )
44024402 trim1 = Dispatch ( (ltrim1 , (list , tuple )),
44034403 (atrim1 , (N .ndarray ,)) )
4404-
4404+
44054405## CORRELATION FCNS:
44064406 paired = Dispatch ( (lpaired , (list , tuple )),
44074407 (apaired , (N .ndarray ,)) )
@@ -4417,7 +4417,7 @@ def afindwithin(data):
44174417 (akendalltau , (N .ndarray ,)) )
44184418 linregress = Dispatch ( (llinregress , (list , tuple )),
44194419 (alinregress , (N .ndarray ,)) )
4420-
4420+
44214421## INFERENTIAL STATS:
44224422 ttest_1samp = Dispatch ( (lttest_1samp , (list , tuple )),
44234423 (attest_1samp , (N .ndarray ,)) )
@@ -4441,7 +4441,7 @@ def afindwithin(data):
44414441 (akruskalwallish , (N .ndarray ,)) )
44424442 friedmanchisquare = Dispatch ( (lfriedmanchisquare , (list , tuple )),
44434443 (afriedmanchisquare , (N .ndarray ,)) )
4444-
4444+
44454445## PROBABILITY CALCS:
44464446 chisqprob = Dispatch ( (lchisqprob , (int , float )),
44474447 (achisqprob , (N .ndarray ,)) )
@@ -4459,7 +4459,7 @@ def afindwithin(data):
44594459 (aerfcc , (N .ndarray ,)) )
44604460 gammln = Dispatch ( (lgammln , (int , float )),
44614461 (agammln , (N .ndarray ,)) )
4462-
4462+
44634463## ANOVA FUNCTIONS:
44644464 F_oneway = Dispatch ( (lF_oneway , (list , tuple )),
44654465 (aF_oneway , (N .ndarray ,)) )
0 commit comments