Classes | |
class | Dispatch |
DISPATCH CODE ##############. More... | |
Functions | |
def | abetacf (a, b, x, verbose=1) |
def | abetai (a, b, x, verbose=1) |
def | achisqprob (chisq, df) |
APROBABILITY CALCULATIONS ####. More... | |
def | achisquare (f_obs, f_exp=None) |
def | acorrelation (X) |
def | acov (x, y, dimension=None, keepdims=0) |
def | acovariance (X) |
ACORRELATION FUNCTIONS ######. More... | |
def | acumfreq (a, numbins=10, defaultreallimits=None) |
def | acumsum (a, dimension=None) |
def | adescribe (inarray, dimension=None) |
def | aerfcc (x) |
def | aF_oneway (args) |
def | aF_value (ER, EF, dfR, dfF) |
def | afindwithin (data) |
def | afprob (dfnum, dfden, F) |
def | afriedmanchisquare (args) |
def | agammln (xx) |
def | ageometricmean (inarray, dimension=None, keepdims=0) |
ACENTRAL TENDENCY ########. More... | |
def | aglm (data, para) |
def | aharmonicmean (inarray, dimension=None, keepdims=0) |
def | ahistogram (inarray, numbins=10, defaultlimits=None, printextras=1) |
def | aitemfreq (a) |
AFREQUENCY FUNCTIONS #######. More... | |
def | akendalltau (x, y) |
def | akruskalwallish (args) |
def | aks_2samp (data1, data2) |
def | aksprob (alam) |
def | akurtosis (a, dimension=None) |
def | akurtosistest (a, dimension=None) |
def | alincc (x, y) |
def | alinregress (args) |
def | amannwhitneyu (x, y) |
def | amasslinregress (args) |
def | amean (inarray, dimension=None, keepdims=0) |
def | amedian (inarray, numbins=1000) |
def | amedianscore (inarray, dimension=None) |
def | amode (a, dimension=None) |
def | amoment (a, moment=1, dimension=None) |
AMOMENTS #############. More... | |
def | anormaltest (a, dimension=None) |
def | aobrientransform (args) |
AVARIABILITY FUNCTIONS #####. More... | |
def | ap2t (pval, df) |
def | apaired (x, y) |
def | apearsonr (x, y, verbose=1) |
def | apercentileofscore (inarray, score, histbins=10, defaultlimits=None) |
def | apointbiserialr (x, y) |
def | arankdata (inarray) |
def | aranksums (x, y) |
def | arelfreq (a, numbins=10, defaultreallimits=None) |
def | asamplestdev (inarray, dimension=None, keepdims=0) |
def | asamplevar (inarray, dimension=None, keepdims=0) |
def | ascoreatpercentile (inarray, percent) |
def | asem (inarray, dimension=None, keepdims=0) |
def | ashellsort (inarray) |
def | asign (a) |
ASUPPORT FUNCTIONS ########. More... | |
def | asignaltonoise (instack, dimension=0) |
def | askew (a, dimension=None) |
def | askewtest (a, dimension=None) |
NORMALITY TESTS ##########. More... | |
def | aspearmanr (x, y) |
def | asquare_of_sums (inarray, dimension=None, keepdims=0) |
def | ass (inarray, dimension=None, keepdims=0) |
def | astdev (inarray, dimension=None, keepdims=0) |
def | asterr (inarray, dimension=None, keepdims=0) |
def | asum (a, dimension=None, keepdims=0) |
def | asumdiffsquared (a, b, dimension=None, keepdims=0) |
def | asummult (array1, array2, dimension=None, keepdims=0) |
def | athreshold (a, threshmin=None, threshmax=None, newval=0) |
ATRIMMING FUNCTIONS #######. More... | |
def | atiecorrect (rankvals) |
def | atmax (a, upperlimit, dimension=None, inclusive=1) |
def | atmean (a, limits=None, inclusive=(1, 1)) |
def | atmin (a, lowerlimit=None, dimension=None, inclusive=1) |
def | atrim1 (a, proportiontocut, tail='right') |
def | atrimboth (a, proportiontocut) |
def | atsem (a, limits=None, inclusive=(1, 1)) |
def | atstdev (a, limits=None, inclusive=(1, 1)) |
def | attest_1samp (a, popmean, printit=0, name='Sample', writemode='a') |
AINFERENTIAL STATISTICS #####. More... | |
def | attest_ind (a, b, dimension=None, printit=0, name1='Samp1', name2='Samp2', writemode='a') |
def | attest_rel (a, b, dimension=None, printit=0, name1='Samp1', name2='Samp2', writemode='a') |
def | atvar (a, limits=None, inclusive=(1, 1)) |
def | avar (inarray, dimension=None, keepdims=0) |
def | avariation (a, dimension=None) |
def | awilcoxont (x, y) |
def | az (a, score) |
def | azmap (scores, compare, dimension=0) |
def | azprob (z) |
def | azs (a) |
def | dices (x, y) |
def | F_value_multivariate (ER, EF, dfnum, dfden) |
def | icc (x, y=None, verbose=0) |
def | lbetacf (a, b, x) |
def | lbetai (a, b, x) |
def | lchisqprob (chisq, df) |
PROBABILITY CALCULATIONS ####. More... | |
def | lchisquare (f_obs, f_exp=None) |
def | lcov (x, y, keepdims=0) |
def | lcumfreq (inlist, numbins=10, defaultreallimits=None) |
def | lcumsum (inlist) |
def | ldescribe (inlist) |
def | lerfcc (x) |
def | lF_oneway (lists) |
ANOVA CALCULATIONS #######. More... | |
def | lF_value (ER, EF, dfnum, dfden) |
def | lfindwithin (data) |
def | lfprob (dfnum, dfden, F) |
def | lfriedmanchisquare (args) |
def | lgammln (xx) |
def | lgeometricmean (inlist) |
def | lharmonicmean (inlist) |
def | lhistogram (inlist, numbins=10, defaultreallimits=None, printextras=0) |
def | lincr (l, cap) |
def | litemfreq (inlist) |
FREQUENCY STATS ##########. More... | |
def | lkendalltau (x, y) |
def | lkruskalwallish (args) |
def | lks_2samp (data1, data2) |
def | lksprob (alam) |
def | lkurtosis (inlist) |
def | llincc (x, y) |
def | llinregress (x, y) |
def | lmannwhitneyu (x, y) |
def | lmean (inlist) |
def | lmedian (inlist, numbins=1000) |
def | lmedianscore (inlist) |
def | lmode (inlist) |
def | lmoment (inlist, moment=1) |
MOMENTS #############. More... | |
def | lobrientransform (args) |
VARIABILITY FUNCTIONS ######. More... | |
def | lpaired (x, y) |
CORRELATION FUNCTIONS ######. More... | |
def | lpearsonr (x, y) |
def | lpercentileofscore (inlist, score, histbins=10, defaultlimits=None) |
def | lpointbiserialr (x, y) |
def | lrankdata (inlist) |
def | lranksums (x, y) |
def | lrelfreq (inlist, numbins=10, defaultreallimits=None) |
def | lsamplestdev (inlist) |
def | lsamplevar (inlist) |
def | lscoreatpercentile (inlist, percent) |
def | lsem (inlist) |
def | lshellsort (inlist) |
def | lskew (inlist) |
def | lspearmanr (x, y) |
def | lsquare_of_sums (inlist) |
def | lss (inlist) |
def | lstdev (inlist) |
def | lsterr (inlist) |
def | lsum (inlist) |
def | lsumdiffsquared (x, y) |
def | lsummult (list1, list2) |
def | ltiecorrect (rankvals) |
def | ltrim1 (l, proportiontocut, tail='right') |
def | ltrimboth (l, proportiontocut) |
TRIMMING FUNCTIONS #######. More... | |
def | lttest_1samp (a, popmean, printit=0, name='Sample', writemode='a') |
INFERENTIAL STATISTICS #####. More... | |
def | lttest_ind (a, b, printit=0, name1='Samp1', name2='Samp2', writemode='a') |
def | lttest_rel (a, b, printit=0, name1='Sample1', name2='Sample2', writemode='a') |
def | lvar (inlist) |
def | lvariation (inlist) |
def | lwilcoxont (x, y) |
def | lz (inlist, score) |
def | lzprob (z) |
def | lzs (inlist) |
def | outputfstats (Enum, Eden, dfnum, dfden, f, prob) |
def | outputpairedstats (fname, writemode, name1, n1, m1, se1, min1, max1, name2, n2, m2, se2, min2, max2, statname, stat, prob) |
def | writecc (listoflists, file, writetype='w', extra=2) |
SUPPORT FUNCTIONS #######. More... | |
Variables | |
float | __version__ = 0.6 |
betacf = Dispatch( (lbetacf, (IntType, FloatType)), ) | |
betai = Dispatch( (lbetai, (IntType, FloatType)), ) | |
chisqprob = Dispatch( (lchisqprob, (IntType, FloatType)), ) | |
PROBABILITY CALCS: More... | |
chisquare = Dispatch( (lchisquare, (ListType, TupleType)), ) | |
cumfreq = Dispatch( (lcumfreq, (ListType, TupleType)), ) | |
cumsum = Dispatch( (lcumsum, (ListType, TupleType)), ) | |
describe = Dispatch( (ldescribe, (ListType, TupleType)), ) | |
erfcc = Dispatch( (lerfcc, (IntType, FloatType)), ) | |
F_oneway = Dispatch( (lF_oneway, (ListType, TupleType)), ) | |
ANOVA FUNCTIONS: More... | |
F_value = Dispatch( (lF_value, (ListType, TupleType)), ) | |
findwithin = Dispatch( (lfindwithin, (ListType, TupleType)), ) | |
fprob = Dispatch( (lfprob, (IntType, FloatType)), ) | |
friedmanchisquare = Dispatch( (lfriedmanchisquare, (ListType, TupleType)), ) | |
gammln = Dispatch( (lgammln, (IntType, FloatType)), ) | |
geometricmean = Dispatch( (lgeometricmean, (ListType, TupleType)), ) | |
DISPATCH LISTS AND TUPLES TO ABOVE FCNS #########. More... | |
harmonicmean = Dispatch( (lharmonicmean, (ListType, TupleType)), ) | |
histogram = Dispatch( (lhistogram, (ListType, TupleType)), ) | |
incr = Dispatch( (lincr, (ListType, TupleType)), ) | |
SUPPORT FUNCTIONS: More... | |
itemfreq = Dispatch( (litemfreq, (ListType, TupleType)), ) | |
FREQUENCY STATISTICS: More... | |
kendalltau = Dispatch( (lkendalltau, (ListType, TupleType)), ) | |
kruskalwallish = Dispatch( (lkruskalwallish, (ListType, TupleType)), ) | |
ks_2samp = Dispatch( (lks_2samp, (ListType, TupleType)), ) | |
ksprob = Dispatch( (lksprob, (IntType, FloatType)), ) | |
kurtosis = Dispatch( (lkurtosis, (ListType, TupleType)), ) | |
kurtosistest | |
LA = LinearAlgebra | |
lincc | |
linregress = Dispatch( (llinregress, (ListType, TupleType)), ) | |
mannwhitneyu = Dispatch( (lmannwhitneyu, (ListType, TupleType)), ) | |
mean = Dispatch( (lmean, (ListType, TupleType)), ) | |
median = Dispatch( (lmedian, (ListType, TupleType)), ) | |
medianscore = Dispatch( (lmedianscore, (ListType, TupleType)), ) | |
mode = Dispatch( (lmode, (ListType, TupleType)), ) | |
moment = Dispatch( (lmoment, (ListType, TupleType)), ) | |
MOMENTS: More... | |
normaltest | |
obrientransform = Dispatch( (lobrientransform, (ListType, TupleType)), ) | |
VARIABILITY: More... | |
paired = Dispatch( (lpaired, (ListType, TupleType)), ) | |
CORRELATION FCNS: More... | |
pearsonr = Dispatch( (lpearsonr, (ListType, TupleType)), ) | |
percentileofscore = Dispatch( (lpercentileofscore, (ListType, TupleType)), ) | |
pointbiserialr = Dispatch( (lpointbiserialr, (ListType, TupleType)), ) | |
rankdata = Dispatch( (lrankdata, (ListType, TupleType)), ) | |
ranksums = Dispatch( (lranksums, (ListType, TupleType)), ) | |
relfreq = Dispatch( (lrelfreq, (ListType, TupleType)), ) | |
samplestdev = Dispatch( (lsamplestdev, (ListType, TupleType)), ) | |
samplevar = Dispatch( (lsamplevar, (ListType, TupleType)), ) | |
scoreatpercentile = Dispatch( (lscoreatpercentile, (ListType, TupleType)), ) | |
sem = Dispatch( (lsem, (ListType, TupleType)), ) | |
shellsort = Dispatch( (lshellsort, (ListType, TupleType)), ) | |
signaltonoise = Dispatch( (asignaltonoise, (N.ndarray,)),) | |
skew = Dispatch( (lskew, (ListType, TupleType)), ) | |
skewtest | |
DISTRIBUTION TESTS. More... | |
spearmanr = Dispatch( (lspearmanr, (ListType, TupleType)), ) | |
square_of_sums = Dispatch( (lsquare_of_sums, (ListType, TupleType)), ) | |
ss = Dispatch( (lss, (ListType, TupleType)), ) | |
stdev = Dispatch( (lstdev, (ListType, TupleType)), ) | |
sterr = Dispatch( (lsterr, (ListType, TupleType)), ) | |
sum = Dispatch( (lsum, (ListType, TupleType)), ) | |
sumdiffsquared = Dispatch( (lsumdiffsquared, (ListType, TupleType)), ) | |
summult = Dispatch( (lsummult, (ListType, TupleType)), ) | |
threshold = Dispatch( (athreshold, (N.ndarray,)),) | |
TRIMMING FCNS: More... | |
tiecorrect = Dispatch( (ltiecorrect, (ListType, TupleType)), ) | |
tmean = Dispatch( (atmean, (N.ndarray,)) ) | |
trim1 = Dispatch( (ltrim1, (ListType, TupleType)), ) | |
trimboth = Dispatch( (ltrimboth, (ListType, TupleType)), ) | |
TRIMMING FCNS: More... | |
tsem = Dispatch( (atsem, (N.ndarray,)) ) | |
tstdev = Dispatch( (atstdev, (N.ndarray,)) ) | |
ttest_1samp = Dispatch( (lttest_1samp, (ListType, TupleType)), ) | |
INFERENTIAL STATS: More... | |
ttest_ind = Dispatch( (lttest_ind, (ListType, TupleType)), ) | |
ttest_rel = Dispatch( (lttest_rel, (ListType, TupleType)), ) | |
tvar = Dispatch( (atvar, (N.ndarray,)) ) | |
var = Dispatch( (lvar, (ListType, TupleType)), ) | |
variation = Dispatch( (lvariation, (ListType, TupleType)), ) | |
wilcoxont = Dispatch( (lwilcoxont, (ListType, TupleType)), ) | |
z = Dispatch( (lz, (ListType, TupleType)), ) | |
zprob = Dispatch( (lzprob, (IntType, FloatType)), ) | |
zs = Dispatch( (lzs, (ListType, TupleType)), ) | |
def wiimote.stats.abetacf | ( | a, | |
b, | |||
x, | |||
verbose = 1 |
|||
) |
def wiimote.stats.abetai | ( | a, | |
b, | |||
x, | |||
verbose = 1 |
|||
) |
Returns the incomplete beta function: I-sub-x(a,b) = 1/B(a,b)*(Integral(0,x) of t^(a-1)(1-t)^(b-1) dt) where a,b>0 and B(a,b) = G(a)*G(b)/(G(a+b)) where G(a) is the gamma function of a. The continued fraction formulation is implemented here, using the betacf function. (Adapted from: Numerical Recipies in C.) Can handle multiple dimensions. Usage: abetai(a,b,x,verbose=1)
def wiimote.stats.achisqprob | ( | chisq, | |
df | |||
) |
APROBABILITY CALCULATIONS ####.
Returns the (1-tail) probability value associated with the provided chi-square value and df. Heavily modified from chisq.c in Gary Perlman's |Stat. Can handle multiple dimensions. Usage: achisqprob(chisq,df) chisq=chisquare stat., df=degrees of freedom
def wiimote.stats.achisquare | ( | f_obs, | |
f_exp = None |
|||
) |
Calculates a one-way chi square for array of observed frequencies and returns the result. If no expected frequencies are given, the total N is assumed to be equally distributed across all groups. @@@NOT RIGHT?? Usage: achisquare(f_obs, f_exp=None) f_obs = array of observed cell freq. Returns: chisquare-statistic, associated p-value
def wiimote.stats.acorrelation | ( | X | ) |
def wiimote.stats.acov | ( | x, | |
y, | |||
dimension = None , |
|||
keepdims = 0 |
|||
) |
Returns the estimated covariance of the values in the passed array (i.e., N-1). Dimension can equal None (ravel array first), an integer (the dimension over which to operate), or a sequence (operate over multiple dimensions). Set keepdims=1 to return an array with the same number of dimensions as inarray. Usage: acov(x,y,dimension=None,keepdims=0)
def wiimote.stats.acovariance | ( | X | ) |
def wiimote.stats.acumfreq | ( | a, | |
numbins = 10 , |
|||
defaultreallimits = None |
|||
) |
Returns a cumulative frequency histogram, using the histogram function. Defaultreallimits can be None (use all data), or a 2-sequence containing lower and upper limits on values to include. Usage: acumfreq(a,numbins=10,defaultreallimits=None) Returns: array of cumfreq bin values, lowerreallimit, binsize, extrapoints
def wiimote.stats.acumsum | ( | a, | |
dimension = None |
|||
) |
Returns an array consisting of the cumulative sum of the items in the passed array. Dimension can equal None (ravel array first), an integer (the dimension over which to operate), or a sequence (operate over multiple dimensions, but this last one just barely makes sense). Usage: acumsum(a,dimension=None)
def wiimote.stats.adescribe | ( | inarray, | |
dimension = None |
|||
) |
Returns several descriptive statistics of the passed array. Dimension can equal None (ravel array first), an integer (the dimension over which to operate), or a sequence (operate over multiple dimensions). Usage: adescribe(inarray,dimension=None) Returns: n, (min,max), mean, standard deviation, skew, kurtosis
def wiimote.stats.aerfcc | ( | x | ) |
def wiimote.stats.aF_oneway | ( | args | ) |
def wiimote.stats.aF_value | ( | ER, | |
EF, | |||
dfR, | |||
dfF | |||
) |
Returns an F-statistic given the following: ER = error associated with the null hypothesis (the Restricted model) EF = error associated with the alternate hypothesis (the Full model) dfR = degrees of freedom the Restricted model dfF = degrees of freedom associated with the Restricted model
def wiimote.stats.afindwithin | ( | data | ) |
def wiimote.stats.afprob | ( | dfnum, | |
dfden, | |||
F | |||
) |
Returns the 1-tailed significance level (p-value) of an F statistic given the degrees of freedom for the numerator (dfR-dfF) and the degrees of freedom for the denominator (dfF). Can handle multiple dims for F. Usage: afprob(dfnum, dfden, F) where usually dfnum=dfbn, dfden=dfwn
def wiimote.stats.afriedmanchisquare | ( | args | ) |
Friedman Chi-Square is a non-parametric, one-way within-subjects ANOVA. This function calculates the Friedman Chi-square test for repeated measures and returns the result, along with the associated probability value. It assumes 3 or more repeated measures. Only 3 levels requires a minimum of 10 subjects in the study. Four levels requires 5 subjects per level(??). Usage: afriedmanchisquare(*args) args are separate arrays for 2+ conditions Returns: chi-square statistic, associated p-value
def wiimote.stats.agammln | ( | xx | ) |
def wiimote.stats.ageometricmean | ( | inarray, | |
dimension = None , |
|||
keepdims = 0 |
|||
) |
ACENTRAL TENDENCY ########.
Calculates the geometric mean of the values in the passed array. That is: n-th root of (x1 * x2 * ... * xn). Defaults to ALL values in the passed array. Use dimension=None to flatten array first. REMEMBER: if dimension=0, it collapses over dimension 0 ('rows' in a 2D array) only, and if dimension is a sequence, it collapses over all specified dimensions. If keepdims is set to 1, the resulting array will have as many dimensions as inarray, with only 1 'level' per dim that was collapsed over. Usage: ageometricmean(inarray,dimension=None,keepdims=0) Returns: geometric mean computed over dim(s) listed in dimension
def wiimote.stats.aglm | ( | data, | |
para | |||
) |
Calculates a linear model fit ... anova/ancova/lin-regress/t-test/etc. Taken from: Peterson et al. Statistical limitations in functional neuroimaging I. Non-inferential methods and statistical models. Phil Trans Royal Soc Lond B 354: 1239-1260. Usage: aglm(data,para) Returns: statistic, p-value ???
def wiimote.stats.aharmonicmean | ( | inarray, | |
dimension = None , |
|||
keepdims = 0 |
|||
) |
Calculates the harmonic mean of the values in the passed array. That is: n / (1/x1 + 1/x2 + ... + 1/xn). Defaults to ALL values in the passed array. Use dimension=None to flatten array first. REMEMBER: if dimension=0, it collapses over dimension 0 ('rows' in a 2D array) only, and if dimension is a sequence, it collapses over all specified dimensions. If keepdims is set to 1, the resulting array will have as many dimensions as inarray, with only 1 'level' per dim that was collapsed over. Usage: aharmonicmean(inarray,dimension=None,keepdims=0) Returns: harmonic mean computed over dim(s) in dimension
def wiimote.stats.ahistogram | ( | inarray, | |
numbins = 10 , |
|||
defaultlimits = None , |
|||
printextras = 1 |
|||
) |
Returns (i) an array of histogram bin counts, (ii) the smallest value of the histogram binning, and (iii) the bin width (the last 2 are not necessarily integers). Default number of bins is 10. Defaultlimits can be None (the routine picks bins spanning all the numbers in the inarray) or a 2-sequence (lowerlimit, upperlimit). Returns all of the following: array of bin values, lowerreallimit, binsize, extrapoints. Usage: ahistogram(inarray,numbins=10,defaultlimits=None,printextras=1) Returns: (array of bin counts, bin-minimum, min-width, #-points-outside-range)
def wiimote.stats.aitemfreq | ( | a | ) |
AFREQUENCY FUNCTIONS #######.
Returns a 2D array of item frequencies. Column 1 contains item values, column 2 contains their respective counts. Assumes a 1D array is passed. @@@sorting OK? Usage: aitemfreq(a) Returns: a 2D frequency table (col [0:n-1]=scores, col n=frequencies)
def wiimote.stats.akendalltau | ( | x, | |
y | |||
) |
def wiimote.stats.akruskalwallish | ( | args | ) |
The Kruskal-Wallis H-test is a non-parametric ANOVA for 3 or more groups, requiring at least 5 subjects in each group. This function calculates the Kruskal-Wallis H and associated p-value for 3 or more independent samples. Usage: akruskalwallish(*args) args are separate arrays for 3+ conditions Returns: H-statistic (corrected for ties), associated p-value
def wiimote.stats.aks_2samp | ( | data1, | |
data2 | |||
) |
def wiimote.stats.aksprob | ( | alam | ) |
def wiimote.stats.akurtosis | ( | a, | |
dimension = None |
|||
) |
Returns the kurtosis of a distribution (normal ==> 3.0; >3 means heavier in the tails, and usually more peaked). Use akurtosistest() to see if it's close enough. Dimension can equal None (ravel array first), an integer (the dimension over which to operate), or a sequence (operate over multiple dimensions). Usage: akurtosis(a,dimension=None) Returns: kurtosis of values in a along dimension, and ZERO where all vals equal
def wiimote.stats.akurtosistest | ( | a, | |
dimension = None |
|||
) |
Tests whether a dataset has normal kurtosis (i.e., kurtosis=3(n-1)/(n+1)) Valid only for n>20. Dimension can equal None (ravel array first), an integer (the dimension over which to operate), or a sequence (operate over multiple dimensions). Usage: akurtosistest(a,dimension=None) Returns: z-score and 2-tail z-probability, returns 0 for bad pixels
def wiimote.stats.alincc | ( | x, | |
y | |||
) |
def wiimote.stats.alinregress | ( | args | ) |
Calculates a regression line on two arrays, x and y, corresponding to x,y pairs. If a single 2D array is passed, alinregress finds dim with 2 levels and splits data into x,y pairs along that dim. Usage: alinregress(*args) args=2 equal-length arrays, or one 2D array Returns: slope, intercept, r, two-tailed prob, sterr-of-the-estimate, n
def wiimote.stats.amannwhitneyu | ( | x, | |
y | |||
) |
Calculates a Mann-Whitney U statistic on the provided scores and returns the result. Use only when the n in each condition is < 20 and you have 2 independent samples of ranks. REMEMBER: Mann-Whitney U is significant if the u-obtained is LESS THAN or equal to the critical value of U. Usage: amannwhitneyu(x,y) where x,y are arrays of values for 2 conditions Returns: u-statistic, one-tailed p-value (i.e., p(z(U)))
def wiimote.stats.amasslinregress | ( | args | ) |
def wiimote.stats.amean | ( | inarray, | |
dimension = None , |
|||
keepdims = 0 |
|||
) |
Calculates the arithmatic mean of the values in the passed array. That is: 1/n * (x1 + x2 + ... + xn). Defaults to ALL values in the passed array. Use dimension=None to flatten array first. REMEMBER: if dimension=0, it collapses over dimension 0 ('rows' in a 2D array) only, and if dimension is a sequence, it collapses over all specified dimensions. If keepdims is set to 1, the resulting array will have as many dimensions as inarray, with only 1 'level' per dim that was collapsed over. Usage: amean(inarray,dimension=None,keepdims=0) Returns: arithematic mean calculated over dim(s) in dimension
def wiimote.stats.amedian | ( | inarray, | |
numbins = 1000 |
|||
) |
Calculates the COMPUTED median value of an array of numbers, given the number of bins to use for the histogram (more bins approaches finding the precise median value of the array; default number of bins = 1000). From G.W. Heiman's Basic Stats, or CRC Probability & Statistics. NOTE: THIS ROUTINE ALWAYS uses the entire passed array (flattens it first). Usage: amedian(inarray,numbins=1000) Returns: median calculated over ALL values in inarray
def wiimote.stats.amedianscore | ( | inarray, | |
dimension = None |
|||
) |
Returns the 'middle' score of the passed array. If there is an even number of scores, the mean of the 2 middle scores is returned. Can function with 1D arrays, or on the FIRST dimension of 2D arrays (i.e., dimension can be None, to pre-flatten the array, or else dimension must equal 0). Usage: amedianscore(inarray,dimension=None) Returns: 'middle' score of the array, or the mean of the 2 middle scores
def wiimote.stats.amode | ( | a, | |
dimension = None |
|||
) |
Returns an array of the modal (most common) score in the passed array. If there is more than one such score, ONLY THE FIRST is returned. The bin-count for the modal values is also returned. Operates on whole array (dimension=None), or on a given dimension. Usage: amode(a, dimension=None) Returns: array of bin-counts for mode(s), array of corresponding modal values
def wiimote.stats.amoment | ( | a, | |
moment = 1 , |
|||
dimension = None |
|||
) |
AMOMENTS #############.
Calculates the nth moment about the mean for a sample (defaults to the 1st moment). Generally used to calculate coefficients of skewness and kurtosis. Dimension can equal None (ravel array first), an integer (the dimension over which to operate), or a sequence (operate over multiple dimensions). Usage: amoment(a,moment=1,dimension=None) Returns: appropriate moment along given dimension
def wiimote.stats.anormaltest | ( | a, | |
dimension = None |
|||
) |
Tests whether skew and/OR kurtosis of dataset differs from normal curve. Can operate over multiple dimensions. Dimension can equal None (ravel array first), an integer (the dimension over which to operate), or a sequence (operate over multiple dimensions). Usage: anormaltest(a,dimension=None) Returns: z-score and 2-tail probability
def wiimote.stats.aobrientransform | ( | args | ) |
AVARIABILITY FUNCTIONS #####.
Computes a transform on input data (any number of columns). Used to test for homogeneity of variance prior to running one-way stats. Each array in *args is one level of a factor. If an F_oneway() run on the transformed data and found significant, variances are unequal. From Maxwell and Delaney, p.112. Usage: aobrientransform(*args) *args = 1D arrays, one per level of factor Returns: transformed data for use in an ANOVA
def wiimote.stats.ap2t | ( | pval, | |
df | |||
) |
Tries to compute a t-value from a p-value (or pval array) and associated df. SLOW for large numbers of elements(!) as it re-computes p-values 20 times (smaller step-sizes) at which point it decides it's done. Keeps the signs of the input array. Returns 1000 (or -1000) if t>100. Usage: ap2t(pval,df) Returns: an array of t-values with the shape of pval
def wiimote.stats.apaired | ( | x, | |
y | |||
) |
def wiimote.stats.apearsonr | ( | x, | |
y, | |||
verbose = 1 |
|||
) |
def wiimote.stats.apercentileofscore | ( | inarray, | |
score, | |||
histbins = 10 , |
|||
defaultlimits = None |
|||
) |
def wiimote.stats.apointbiserialr | ( | x, | |
y | |||
) |
Calculates a point-biserial correlation coefficient and the associated probability value. Taken from Heiman's Basic Statistics for the Behav. Sci (1st), p.194. Usage: apointbiserialr(x,y) where x,y are equal length arrays Returns: Point-biserial r, two-tailed p-value
def wiimote.stats.arankdata | ( | inarray | ) |
def wiimote.stats.aranksums | ( | x, | |
y | |||
) |
def wiimote.stats.arelfreq | ( | a, | |
numbins = 10 , |
|||
defaultreallimits = None |
|||
) |
Returns a relative frequency histogram, using the histogram function. Defaultreallimits can be None (use all data), or a 2-sequence containing lower and upper limits on values to include. Usage: arelfreq(a,numbins=10,defaultreallimits=None) Returns: array of cumfreq bin values, lowerreallimit, binsize, extrapoints
def wiimote.stats.asamplestdev | ( | inarray, | |
dimension = None , |
|||
keepdims = 0 |
|||
) |
Returns the sample standard deviation of the values in the passed array (i.e., using N). Dimension can equal None (ravel array first), an integer (the dimension over which to operate), or a sequence (operate over multiple dimensions). Set keepdims=1 to return an array with the same number of dimensions as inarray. Usage: asamplestdev(inarray,dimension=None,keepdims=0)
def wiimote.stats.asamplevar | ( | inarray, | |
dimension = None , |
|||
keepdims = 0 |
|||
) |
Returns the sample standard deviation of the values in the passed array (i.e., using N). Dimension can equal None (ravel array first), an integer (the dimension over which to operate), or a sequence (operate over multiple dimensions). Set keepdims=1 to return an array with the same number of dimensions as inarray. Usage: asamplevar(inarray,dimension=None,keepdims=0)
def wiimote.stats.ascoreatpercentile | ( | inarray, | |
percent | |||
) |
def wiimote.stats.asem | ( | inarray, | |
dimension = None , |
|||
keepdims = 0 |
|||
) |
Returns the standard error of the mean (i.e., using N) of the values in the passed array. Dimension can equal None (ravel array first), an integer (the dimension over which to operate), or a sequence (operate over multiple dimensions). Set keepdims=1 to return an array with the same number of dimensions as inarray. Usage: asem(inarray,dimension=None, keepdims=0)
def wiimote.stats.ashellsort | ( | inarray | ) |
def wiimote.stats.asign | ( | a | ) |
def wiimote.stats.asignaltonoise | ( | instack, | |
dimension = 0 |
|||
) |
Calculates signal-to-noise. Dimension can equal None (ravel array first), an integer (the dimension over which to operate), or a sequence (operate over multiple dimensions). Usage: asignaltonoise(instack,dimension=0): Returns: array containing the value of (mean/stdev) along dimension, or 0 when stdev=0
def wiimote.stats.askew | ( | a, | |
dimension = None |
|||
) |
Returns the skewness of a distribution (normal ==> 0.0; >0 means extra weight in left tail). Use askewtest() to see if it's close enough. Dimension can equal None (ravel array first), an integer (the dimension over which to operate), or a sequence (operate over multiple dimensions). Usage: askew(a, dimension=None) Returns: skew of vals in a along dimension, returning ZERO where all vals equal
def wiimote.stats.askewtest | ( | a, | |
dimension = None |
|||
) |
NORMALITY TESTS ##########.
Tests whether the skew is significantly different from a normal distribution. Dimension can equal None (ravel array first), an integer (the dimension over which to operate), or a sequence (operate over multiple dimensions). Usage: askewtest(a,dimension=None) Returns: z-score and 2-tail z-probability
def wiimote.stats.aspearmanr | ( | x, | |
y | |||
) |
def wiimote.stats.asquare_of_sums | ( | inarray, | |
dimension = None , |
|||
keepdims = 0 |
|||
) |
Adds the values in the passed array, squares that sum, and returns the result. Dimension can equal None (ravel array first), an integer (the dimension over which to operate), or a sequence (operate over multiple dimensions). If keepdims=1, the returned array will have the same NUMBER of dimensions as the original. Usage: asquare_of_sums(inarray, dimension=None, keepdims=0) Returns: the square of the sum over dim(s) in dimension
def wiimote.stats.ass | ( | inarray, | |
dimension = None , |
|||
keepdims = 0 |
|||
) |
Squares each value in the passed array, adds these squares & returns the result. Unfortunate function name. :-) Defaults to ALL values in the array. Dimension can equal None (ravel array first), an integer (the dimension over which to operate), or a sequence (operate over multiple dimensions). Set keepdims=1 to maintain the original number of dimensions. Usage: ass(inarray, dimension=None, keepdims=0) Returns: sum-along-'dimension' for (inarray*inarray)
def wiimote.stats.astdev | ( | inarray, | |
dimension = None , |
|||
keepdims = 0 |
|||
) |
Returns the estimated population standard deviation of the values in the passed array (i.e., N-1). Dimension can equal None (ravel array first), an integer (the dimension over which to operate), or a sequence (operate over multiple dimensions). Set keepdims=1 to return an array with the same number of dimensions as inarray. Usage: astdev(inarray,dimension=None,keepdims=0)
def wiimote.stats.asterr | ( | inarray, | |
dimension = None , |
|||
keepdims = 0 |
|||
) |
Returns the estimated population standard error of the values in the passed array (i.e., N-1). Dimension can equal None (ravel array first), an integer (the dimension over which to operate), or a sequence (operate over multiple dimensions). Set keepdims=1 to return an array with the same number of dimensions as inarray. Usage: asterr(inarray,dimension=None,keepdims=0)
def wiimote.stats.asum | ( | a, | |
dimension = None , |
|||
keepdims = 0 |
|||
) |
An alternative to the Numeric.add.reduce function, which allows one to (1) collapse over multiple dimensions at once, and/or (2) to retain all dimensions in the original array (squashing one down to size. Dimension can equal None (ravel array first), an integer (the dimension over which to operate), or a sequence (operate over multiple dimensions). If keepdims=1, the resulting array will have as many dimensions as the input array. Usage: asum(a, dimension=None, keepdims=0) Returns: array summed along 'dimension'(s), same _number_ of dims if keepdims=1
def wiimote.stats.asumdiffsquared | ( | a, | |
b, | |||
dimension = None , |
|||
keepdims = 0 |
|||
) |
Takes pairwise differences of the values in arrays a and b, squares these differences, and returns the sum of these squares. Dimension can equal None (ravel array first), an integer (the dimension over which to operate), or a sequence (operate over multiple dimensions). keepdims=1 means the return shape = len(a.shape) = len(b.shape) Usage: asumdiffsquared(a,b) Returns: sum[ravel(a-b)**2]
def wiimote.stats.asummult | ( | array1, | |
array2, | |||
dimension = None , |
|||
keepdims = 0 |
|||
) |
Multiplies elements in array1 and array2, element by element, and returns the sum (along 'dimension') of all resulting multiplications. Dimension can equal None (ravel array first), an integer (the dimension over which to operate), or a sequence (operate over multiple dimensions). A trivial function, but included for completeness. Usage: asummult(array1,array2,dimension=None,keepdims=0)
def wiimote.stats.athreshold | ( | a, | |
threshmin = None , |
|||
threshmax = None , |
|||
newval = 0 |
|||
) |
ATRIMMING FUNCTIONS #######.
deleted around() as it's in numpy now
Like Numeric.clip() except that values <threshmid or >threshmax are replaced by newval instead of by threshmin/threshmax (respectively). Usage: athreshold(a,threshmin=None,threshmax=None,newval=0) Returns: a, with values <threshmin or >threshmax replaced with newval
def wiimote.stats.atiecorrect | ( | rankvals | ) |
Tie-corrector for ties in Mann Whitney U and Kruskal Wallis H tests. See Siegel, S. (1956) Nonparametric Statistics for the Behavioral Sciences. New York: McGraw-Hill. Code adapted from |Stat rankind.c code. Usage: atiecorrect(rankvals) Returns: T correction factor for U or H
def wiimote.stats.atmax | ( | a, | |
upperlimit, | |||
dimension = None , |
|||
inclusive = 1 |
|||
) |
Returns the maximum value of a, along dimension, including only values greater than (or equal to, if inclusive=1) upperlimit. If the limit is set to None, a limit larger than the max value in the array is used. Usage: atmax(a,upperlimit,dimension=None,inclusive=1)
def wiimote.stats.atmean | ( | a, | |
limits = None , |
|||
inclusive = (1,1) |
|||
) |
Returns the arithmetic mean of all values in an array, ignoring values strictly outside the sequence passed to 'limits'. Note: either limit in the sequence, or the value of limits itself, can be set to None. The inclusive list/tuple determines whether the lower and upper limiting bounds (respectively) are open/exclusive (0) or closed/inclusive (1). Usage: atmean(a,limits=None,inclusive=(1,1))
def wiimote.stats.atmin | ( | a, | |
lowerlimit = None , |
|||
dimension = None , |
|||
inclusive = 1 |
|||
) |
def wiimote.stats.atrim1 | ( | a, | |
proportiontocut, | |||
tail = 'right' |
|||
) |
Slices off the passed proportion of items from ONE end of the passed array (i.e., if proportiontocut=0.1, slices off 'leftmost' or 'rightmost' 10% of scores). Slices off LESS if proportion results in a non-integer slice index (i.e., conservatively slices off proportiontocut). Usage: atrim1(a,proportiontocut,tail='right') or set tail='left' Returns: trimmed version of array a
def wiimote.stats.atrimboth | ( | a, | |
proportiontocut | |||
) |
Slices off the passed proportion of items from BOTH ends of the passed array (i.e., with proportiontocut=0.1, slices 'leftmost' 10% AND 'rightmost' 10% of scores. You must pre-sort the array if you want "proper" trimming. Slices off LESS if proportion results in a non-integer slice index (i.e., conservatively slices off proportiontocut). Usage: atrimboth (a,proportiontocut) Returns: trimmed version of array a
def wiimote.stats.atsem | ( | a, | |
limits = None , |
|||
inclusive = (1,1) |
|||
) |
Returns the standard error of the mean for the values in an array, (i.e., using N for the denominator), ignoring values strictly outside the sequence passed to 'limits'. Note: either limit in the sequence, or the value of limits itself, can be set to None. The inclusive list/tuple determines whether the lower and upper limiting bounds (respectively) are open/exclusive (0) or closed/inclusive (1). Usage: atsem(a,limits=None,inclusive=(1,1))
def wiimote.stats.atstdev | ( | a, | |
limits = None , |
|||
inclusive = (1,1) |
|||
) |
Returns the standard deviation of all values in an array, ignoring values strictly outside the sequence passed to 'limits'. Note: either limit in the sequence, or the value of limits itself, can be set to None. The inclusive list/tuple determines whether the lower and upper limiting bounds (respectively) are open/exclusive (0) or closed/inclusive (1). Usage: atstdev(a,limits=None,inclusive=(1,1))
def wiimote.stats.attest_1samp | ( | a, | |
popmean, | |||
printit = 0 , |
|||
name = 'Sample' , |
|||
writemode = 'a' |
|||
) |
AINFERENTIAL STATISTICS #####.
Calculates the t-obtained for the independent samples T-test on ONE group of scores a, given a population mean. If printit=1, results are printed to the screen. If printit='filename', the results are output to 'filename' using the given writemode (default=append). Returns t-value, and prob. Usage: attest_1samp(a,popmean,Name='Sample',printit=0,writemode='a') Returns: t-value, two-tailed prob
def wiimote.stats.attest_ind | ( | a, | |
b, | |||
dimension = None , |
|||
printit = 0 , |
|||
name1 = 'Samp1' , |
|||
name2 = 'Samp2' , |
|||
writemode = 'a' |
|||
) |
Calculates the t-obtained T-test on TWO INDEPENDENT samples of scores a, and b. From Numerical Recipies, p.483. If printit=1, results are printed to the screen. If printit='filename', the results are output to 'filename' using the given writemode (default=append). Dimension can equal None (ravel array first), or an integer (the dimension over which to operate on a and b). Usage: attest_ind (a,b,dimension=None,printit=0, Name1='Samp1',Name2='Samp2',writemode='a') Returns: t-value, two-tailed p-value
def wiimote.stats.attest_rel | ( | a, | |
b, | |||
dimension = None , |
|||
printit = 0 , |
|||
name1 = 'Samp1' , |
|||
name2 = 'Samp2' , |
|||
writemode = 'a' |
|||
) |
Calculates the t-obtained T-test on TWO RELATED samples of scores, a and b. From Numerical Recipies, p.483. If printit=1, results are printed to the screen. If printit='filename', the results are output to 'filename' using the given writemode (default=append). Dimension can equal None (ravel array first), or an integer (the dimension over which to operate on a and b). Usage: attest_rel(a,b,dimension=None,printit=0, name1='Samp1',name2='Samp2',writemode='a') Returns: t-value, two-tailed p-value
def wiimote.stats.atvar | ( | a, | |
limits = None , |
|||
inclusive = (1,1) |
|||
) |
Returns the sample variance of values in an array, (i.e., using N-1), ignoring values strictly outside the sequence passed to 'limits'. Note: either limit in the sequence, or the value of limits itself, can be set to None. The inclusive list/tuple determines whether the lower and upper limiting bounds (respectively) are open/exclusive (0) or closed/inclusive (1). ASSUMES A FLAT ARRAY (OR ELSE PREFLATTENS). Usage: atvar(a,limits=None,inclusive=(1,1))
def wiimote.stats.avar | ( | inarray, | |
dimension = None , |
|||
keepdims = 0 |
|||
) |
Returns the estimated population variance of the values in the passed array (i.e., N-1). Dimension can equal None (ravel array first), an integer (the dimension over which to operate), or a sequence (operate over multiple dimensions). Set keepdims=1 to return an array with the same number of dimensions as inarray. Usage: avar(inarray,dimension=None,keepdims=0)
def wiimote.stats.avariation | ( | a, | |
dimension = None |
|||
) |
Returns the coefficient of variation, as defined in CRC Standard Probability and Statistics, p.6. Dimension can equal None (ravel array first), an integer (the dimension over which to operate), or a sequence (operate over multiple dimensions). Usage: avariation(a,dimension=None)
def wiimote.stats.awilcoxont | ( | x, | |
y | |||
) |
def wiimote.stats.az | ( | a, | |
score | |||
) |
def wiimote.stats.azmap | ( | scores, | |
compare, | |||
dimension = 0 |
|||
) |
def wiimote.stats.azprob | ( | z | ) |
Returns the area under the normal curve 'to the left of' the given z value. Thus, for z<0, zprob(z) = 1-tail probability for z>0, 1.0-zprob(z) = 1-tail probability for any z, 2.0*(1.0-zprob(abs(z))) = 2-tail probability Adapted from z.c in Gary Perlman's |Stat. Can handle multiple dimensions. Usage: azprob(z) where z is a z-value
def wiimote.stats.azs | ( | a | ) |
def wiimote.stats.dices | ( | x, | |
y | |||
) |
def wiimote.stats.F_value_multivariate | ( | ER, | |
EF, | |||
dfnum, | |||
dfden | |||
) |
Returns an F-statistic given the following: ER = error associated with the null hypothesis (the Restricted model) EF = error associated with the alternate hypothesis (the Full model) dfR = degrees of freedom the Restricted model dfF = degrees of freedom associated with the Restricted model where ER and EF are matrices from a multivariate F calculation.
def wiimote.stats.icc | ( | x, | |
y = None , |
|||
verbose = 0 |
|||
) |
def wiimote.stats.lbetacf | ( | a, | |
b, | |||
x | |||
) |
def wiimote.stats.lbetai | ( | a, | |
b, | |||
x | |||
) |
Returns the incomplete beta function: I-sub-x(a,b) = 1/B(a,b)*(Integral(0,x) of t^(a-1)(1-t)^(b-1) dt) where a,b>0 and B(a,b) = G(a)*G(b)/(G(a+b)) where G(a) is the gamma function of a. The continued fraction formulation is implemented here, using the betacf function. (Adapted from: Numerical Recipies in C.) Usage: lbetai(a,b,x)
def wiimote.stats.lchisqprob | ( | chisq, | |
df | |||
) |
def wiimote.stats.lchisquare | ( | f_obs, | |
f_exp = None |
|||
) |
Calculates a one-way chi square for list of observed frequencies and returns the result. If no expected frequencies are given, the total N is assumed to be equally distributed across all groups. Usage: lchisquare(f_obs, f_exp=None) f_obs = list of observed cell freq. Returns: chisquare-statistic, associated p-value
def wiimote.stats.lcov | ( | x, | |
y, | |||
keepdims = 0 |
|||
) |
Returns the estimated covariance of the values in the passed array (i.e., N-1). Dimension can equal None (ravel array first), an integer (the dimension over which to operate), or a sequence (operate over multiple dimensions). Set keepdims=1 to return an array with the same number of dimensions as inarray. Usage: lcov(x,y,keepdims=0)
def wiimote.stats.lcumfreq | ( | inlist, | |
numbins = 10 , |
|||
defaultreallimits = None |
|||
) |
def wiimote.stats.lcumsum | ( | inlist | ) |
def wiimote.stats.ldescribe | ( | inlist | ) |
def wiimote.stats.lerfcc | ( | x | ) |
def wiimote.stats.lF_oneway | ( | lists | ) |
ANOVA CALCULATIONS #######.
Performs a 1-way ANOVA, returning an F-value and probability given any number of groups. From Heiman, pp.394-7. Usage: F_oneway(*lists) where *lists is any number of lists, one per treatment group Returns: F value, one-tailed p-value
def wiimote.stats.lF_value | ( | ER, | |
EF, | |||
dfnum, | |||
dfden | |||
) |
Returns an F-statistic given the following: ER = error associated with the null hypothesis (the Restricted model) EF = error associated with the alternate hypothesis (the Full model) dfR-dfF = degrees of freedom of the numerator dfF = degrees of freedom associated with the denominator/Full model Usage: lF_value(ER,EF,dfnum,dfden)
def wiimote.stats.lfindwithin | ( | data | ) |
Returns an integer representing a binary vector, where 1=within- subject factor, 0=between. Input equals the entire data 2D list (i.e., column 0=random factor, column -1=measured values (those two are skipped). Note: input data is in |Stat format ... a list of lists ("2D list") with one row per measured value, first column=subject identifier, last column= score, one in-between column per factor (these columns contain level designations on each factor). See also stats.anova.__doc__. Usage: lfindwithin(data) data in |Stat format
def wiimote.stats.lfprob | ( | dfnum, | |
dfden, | |||
F | |||
) |
def wiimote.stats.lfriedmanchisquare | ( | args | ) |
Friedman Chi-Square is a non-parametric, one-way within-subjects ANOVA. This function calculates the Friedman Chi-square test for repeated measures and returns the result, along with the associated probability value. It assumes 3 or more repeated measures. Only 3 levels requires a minimum of 10 subjects in the study. Four levels requires 5 subjects per level(??). Usage: lfriedmanchisquare(*args) Returns: chi-square statistic, associated p-value
def wiimote.stats.lgammln | ( | xx | ) |
def wiimote.stats.lgeometricmean | ( | inlist | ) |
def wiimote.stats.lharmonicmean | ( | inlist | ) |
def wiimote.stats.lhistogram | ( | inlist, | |
numbins = 10 , |
|||
defaultreallimits = None , |
|||
printextras = 0 |
|||
) |
Returns (i) a list of histogram bin counts, (ii) the smallest value of the histogram binning, and (iii) the bin width (the last 2 are not necessarily integers). Default number of bins is 10. If no sequence object is given for defaultreallimits, the routine picks (usually non-pretty) bins spanning all the numbers in the inlist. Usage: lhistogram (inlist, numbins=10, defaultreallimits=None,suppressoutput=0) Returns: list of bin values, lowerreallimit, binsize, extrapoints
def wiimote.stats.lincr | ( | l, | |
cap | |||
) |
def wiimote.stats.litemfreq | ( | inlist | ) |
def wiimote.stats.lkendalltau | ( | x, | |
y | |||
) |
def wiimote.stats.lkruskalwallish | ( | args | ) |
The Kruskal-Wallis H-test is a non-parametric ANOVA for 3 or more groups, requiring at least 5 subjects in each group. This function calculates the Kruskal-Wallis H-test for 3 or more independent samples and returns the result. Usage: lkruskalwallish(*args) Returns: H-statistic (corrected for ties), associated p-value
def wiimote.stats.lks_2samp | ( | data1, | |
data2 | |||
) |
def wiimote.stats.lksprob | ( | alam | ) |
def wiimote.stats.lkurtosis | ( | inlist | ) |
def wiimote.stats.llincc | ( | x, | |
y | |||
) |
def wiimote.stats.llinregress | ( | x, | |
y | |||
) |
def wiimote.stats.lmannwhitneyu | ( | x, | |
y | |||
) |
Calculates a Mann-Whitney U statistic on the provided scores and returns the result. Use only when the n in each condition is < 20 and you have 2 independent samples of ranks. NOTE: Mann-Whitney U is significant if the u-obtained is LESS THAN or equal to the critical value of U found in the tables. Equivalent to Kruskal-Wallis H with just 2 groups. Usage: lmannwhitneyu(data) Returns: u-statistic, one-tailed p-value (i.e., p(z(U)))
def wiimote.stats.lmean | ( | inlist | ) |
def wiimote.stats.lmedian | ( | inlist, | |
numbins = 1000 |
|||
) |
Returns the computed median value of a list of numbers, given the number of bins to use for the histogram (more bins brings the computed value closer to the median score, default number of bins = 1000). See G.W. Heiman's Basic Stats (1st Edition), or CRC Probability & Statistics. Usage: lmedian (inlist, numbins=1000)
def wiimote.stats.lmedianscore | ( | inlist | ) |
def wiimote.stats.lmode | ( | inlist | ) |
def wiimote.stats.lmoment | ( | inlist, | |
moment = 1 |
|||
) |
MOMENTS #############.
Calculates the nth moment about the mean for a sample (defaults to the 1st moment). Used to calculate coefficients of skewness and kurtosis. Usage: lmoment(inlist,moment=1) Returns: appropriate moment (r) from ... 1/n * SUM((inlist(i)-mean)**r)
def wiimote.stats.lobrientransform | ( | args | ) |
VARIABILITY FUNCTIONS ######.
Computes a transform on input data (any number of columns). Used to test for homogeneity of variance prior to running one-way stats. From Maxwell and Delaney, p.112. Usage: lobrientransform(*args) Returns: transformed data for use in an ANOVA
def wiimote.stats.lpaired | ( | x, | |
y | |||
) |
def wiimote.stats.lpearsonr | ( | x, | |
y | |||
) |
def wiimote.stats.lpercentileofscore | ( | inlist, | |
score, | |||
histbins = 10 , |
|||
defaultlimits = None |
|||
) |
def wiimote.stats.lpointbiserialr | ( | x, | |
y | |||
) |
Calculates a point-biserial correlation coefficient and the associated probability value. Taken from Heiman's Basic Statistics for the Behav. Sci (1st), p.194. Usage: lpointbiserialr(x,y) where x,y are equal-length lists Returns: Point-biserial r, two-tailed p-value
def wiimote.stats.lrankdata | ( | inlist | ) |
def wiimote.stats.lranksums | ( | x, | |
y | |||
) |
def wiimote.stats.lrelfreq | ( | inlist, | |
numbins = 10 , |
|||
defaultreallimits = None |
|||
) |
def wiimote.stats.lsamplestdev | ( | inlist | ) |
def wiimote.stats.lsamplevar | ( | inlist | ) |
def wiimote.stats.lscoreatpercentile | ( | inlist, | |
percent | |||
) |
def wiimote.stats.lsem | ( | inlist | ) |
def wiimote.stats.lshellsort | ( | inlist | ) |
def wiimote.stats.lskew | ( | inlist | ) |
def wiimote.stats.lspearmanr | ( | x, | |
y | |||
) |
def wiimote.stats.lsquare_of_sums | ( | inlist | ) |
def wiimote.stats.lss | ( | inlist | ) |
def wiimote.stats.lstdev | ( | inlist | ) |
def wiimote.stats.lsterr | ( | inlist | ) |
def wiimote.stats.lsum | ( | inlist | ) |
def wiimote.stats.lsumdiffsquared | ( | x, | |
y | |||
) |
def wiimote.stats.lsummult | ( | list1, | |
list2 | |||
) |
def wiimote.stats.ltiecorrect | ( | rankvals | ) |
Corrects for ties in Mann Whitney U and Kruskal Wallis H tests. See Siegel, S. (1956) Nonparametric Statistics for the Behavioral Sciences. New York: McGraw-Hill. Code adapted from |Stat rankind.c code. Usage: ltiecorrect(rankvals) Returns: T correction factor for U or H
def wiimote.stats.ltrim1 | ( | l, | |
proportiontocut, | |||
tail = 'right' |
|||
) |
Slices off the passed proportion of items from ONE end of the passed list (i.e., if proportiontocut=0.1, slices off 'leftmost' or 'rightmost' 10% of scores). Slices off LESS if proportion results in a non-integer slice index (i.e., conservatively slices off proportiontocut). Usage: ltrim1 (l,proportiontocut,tail='right') or set tail='left' Returns: trimmed version of list l
def wiimote.stats.ltrimboth | ( | l, | |
proportiontocut | |||
) |
TRIMMING FUNCTIONS #######.
Slices off the passed proportion of items from BOTH ends of the passed list (i.e., with proportiontocut=0.1, slices 'leftmost' 10% AND 'rightmost' 10% of scores. Assumes list is sorted by magnitude. Slices off LESS if proportion results in a non-integer slice index (i.e., conservatively slices off proportiontocut). Usage: ltrimboth (l,proportiontocut) Returns: trimmed version of list l
def wiimote.stats.lttest_1samp | ( | a, | |
popmean, | |||
printit = 0 , |
|||
name = 'Sample' , |
|||
writemode = 'a' |
|||
) |
INFERENTIAL STATISTICS #####.
Calculates the t-obtained for the independent samples T-test on ONE group of scores a, given a population mean. If printit=1, results are printed to the screen. If printit='filename', the results are output to 'filename' using the given writemode (default=append). Returns t-value, and prob. Usage: lttest_1samp(a,popmean,Name='Sample',printit=0,writemode='a') Returns: t-value, two-tailed prob
def wiimote.stats.lttest_ind | ( | a, | |
b, | |||
printit = 0 , |
|||
name1 = 'Samp1' , |
|||
name2 = 'Samp2' , |
|||
writemode = 'a' |
|||
) |
Calculates the t-obtained T-test on TWO INDEPENDENT samples of scores a, and b. From Numerical Recipies, p.483. If printit=1, results are printed to the screen. If printit='filename', the results are output to 'filename' using the given writemode (default=append). Returns t-value, and prob. Usage: lttest_ind(a,b,printit=0,name1='Samp1',name2='Samp2',writemode='a') Returns: t-value, two-tailed prob
def wiimote.stats.lttest_rel | ( | a, | |
b, | |||
printit = 0 , |
|||
name1 = 'Sample1' , |
|||
name2 = 'Sample2' , |
|||
writemode = 'a' |
|||
) |
Calculates the t-obtained T-test on TWO RELATED samples of scores, a and b. From Numerical Recipies, p.483. If printit=1, results are printed to the screen. If printit='filename', the results are output to 'filename' using the given writemode (default=append). Returns t-value, and prob. Usage: lttest_rel(a,b,printit=0,name1='Sample1',name2='Sample2',writemode='a') Returns: t-value, two-tailed prob
def wiimote.stats.lvar | ( | inlist | ) |
def wiimote.stats.lvariation | ( | inlist | ) |
def wiimote.stats.lwilcoxont | ( | x, | |
y | |||
) |
def wiimote.stats.lz | ( | inlist, | |
score | |||
) |
def wiimote.stats.lzprob | ( | z | ) |
Returns the area under the normal curve 'to the left of' the given z value. Thus, for z<0, zprob(z) = 1-tail probability for z>0, 1.0-zprob(z) = 1-tail probability for any z, 2.0*(1.0-zprob(abs(z))) = 2-tail probability Adapted from z.c in Gary Perlman's |Stat. Usage: lzprob(z)
def wiimote.stats.lzs | ( | inlist | ) |
def wiimote.stats.outputfstats | ( | Enum, | |
Eden, | |||
dfnum, | |||
dfden, | |||
f, | |||
prob | |||
) |
def wiimote.stats.outputpairedstats | ( | fname, | |
writemode, | |||
name1, | |||
n1, | |||
m1, | |||
se1, | |||
min1, | |||
max1, | |||
name2, | |||
n2, | |||
m2, | |||
se2, | |||
min2, | |||
max2, | |||
statname, | |||
stat, | |||
prob | |||
) |
Prints or write to a file stats for two groups, using the name, n, mean, sterr, min and max for each group, as well as the statistic name, its value, and the associated p-value. Usage: outputpairedstats(fname,writemode, name1,n1,mean1,stderr1,min1,max1, name2,n2,mean2,stderr2,min2,max2, statname,stat,prob) Returns: None
def wiimote.stats.writecc | ( | listoflists, | |
file, | |||
writetype = 'w' , |
|||
extra = 2 |
|||
) |
SUPPORT FUNCTIONS #######.
Writes a list of lists to a file in columns, customized by the max size of items within the columns (max size of items in col, +2 characters) to specified file. File-overwrite is the default. Usage: writecc (listoflists,file,writetype='w',extra=2) Returns: None
wiimote.stats.chisqprob = Dispatch( (lchisqprob, (IntType, FloatType)), ) |
wiimote.stats.chisquare = Dispatch( (lchisquare, (ListType, TupleType)), ) |
wiimote.stats.findwithin = Dispatch( (lfindwithin, (ListType, TupleType)), ) |
wiimote.stats.friedmanchisquare = Dispatch( (lfriedmanchisquare, (ListType, TupleType)), ) |
wiimote.stats.geometricmean = Dispatch( (lgeometricmean, (ListType, TupleType)), ) |
wiimote.stats.harmonicmean = Dispatch( (lharmonicmean, (ListType, TupleType)), ) |
wiimote.stats.histogram = Dispatch( (lhistogram, (ListType, TupleType)), ) |
wiimote.stats.kendalltau = Dispatch( (lkendalltau, (ListType, TupleType)), ) |
wiimote.stats.kruskalwallish = Dispatch( (lkruskalwallish, (ListType, TupleType)), ) |
wiimote.stats.kurtosistest |
wiimote.stats.lincc |
wiimote.stats.linregress = Dispatch( (llinregress, (ListType, TupleType)), ) |
wiimote.stats.mannwhitneyu = Dispatch( (lmannwhitneyu, (ListType, TupleType)), ) |
wiimote.stats.medianscore = Dispatch( (lmedianscore, (ListType, TupleType)), ) |
wiimote.stats.normaltest |
wiimote.stats.obrientransform = Dispatch( (lobrientransform, (ListType, TupleType)), ) |
wiimote.stats.percentileofscore = Dispatch( (lpercentileofscore, (ListType, TupleType)), ) |
wiimote.stats.pointbiserialr = Dispatch( (lpointbiserialr, (ListType, TupleType)), ) |
wiimote.stats.samplestdev = Dispatch( (lsamplestdev, (ListType, TupleType)), ) |
wiimote.stats.samplevar = Dispatch( (lsamplevar, (ListType, TupleType)), ) |
wiimote.stats.scoreatpercentile = Dispatch( (lscoreatpercentile, (ListType, TupleType)), ) |
wiimote.stats.shellsort = Dispatch( (lshellsort, (ListType, TupleType)), ) |
wiimote.stats.signaltonoise = Dispatch( (asignaltonoise, (N.ndarray,)),) |
wiimote.stats.skewtest |
DISTRIBUTION TESTS.
wiimote.stats.spearmanr = Dispatch( (lspearmanr, (ListType, TupleType)), ) |
wiimote.stats.square_of_sums = Dispatch( (lsquare_of_sums, (ListType, TupleType)), ) |
wiimote.stats.sumdiffsquared = Dispatch( (lsumdiffsquared, (ListType, TupleType)), ) |
wiimote.stats.threshold = Dispatch( (athreshold, (N.ndarray,)),) |
wiimote.stats.tiecorrect = Dispatch( (ltiecorrect, (ListType, TupleType)), ) |
wiimote.stats.ttest_1samp = Dispatch( (lttest_1samp, (ListType, TupleType)), ) |
wiimote.stats.ttest_ind = Dispatch( (lttest_ind, (ListType, TupleType)), ) |
wiimote.stats.ttest_rel = Dispatch( (lttest_rel, (ListType, TupleType)), ) |
wiimote.stats.variation = Dispatch( (lvariation, (ListType, TupleType)), ) |
wiimote.stats.wilcoxont = Dispatch( (lwilcoxont, (ListType, TupleType)), ) |