BigBrotherBot v1.9.0
System Development Information for the BigBrotherBot project.
Namespaces | Functions | Variables

D:/svn/b3-git/build/lib/b3/lib/statlib/anova.py File Reference

Namespaces

namespace  b3::lib::statlib::anova

Functions

def b3::lib::statlib::anova::aanova
def b3::lib::statlib::anova::Dfull_model
def b3::lib::statlib::anova::Drestrict_mean
def b3::lib::statlib::anova::Drestrict_source
def b3::lib::statlib::anova::multivar_SScalc
 Save it so you don't have to calculate it again next time.
def b3::lib::statlib::anova::subtr_cellmeans
def b3::lib::statlib::anova::F_value_wilks_lambda
def b3::lib::statlib::anova::member
def b3::lib::statlib::anova::setsize
def b3::lib::statlib::anova::subset
def b3::lib::statlib::anova::propersubset
def b3::lib::statlib::anova::numlevels
def b3::lib::statlib::anova::numbitson
def b3::lib::statlib::anova::makebin
def b3::lib::statlib::anova::makelist
def b3::lib::statlib::anova::round4

Variables

list b3::lib::statlib::anova::alluniqueslist = [0]
 Create a list of all unique values in each column, and a list of these Ns.
list b3::lib::statlib::anova::Nlevels = [0]
tuple b3::lib::statlib::anova::Ncells = N.multiply.reduce(Nlevels[1:])
tuple b3::lib::statlib::anova::Nfactors = len(Nlevels[1:])
int b3::lib::statlib::anova::Nallsources = 2
tuple b3::lib::statlib::anova::Nsubjects = len(alluniqueslist[0])
tuple b3::lib::statlib::anova::Bwithins = findwithin(data)
 Within-subj factors defined as those where there are fewer subj than scores in the first level of a factor (quick and dirty; findwithin() below)
tuple b3::lib::statlib::anova::Bbetweens = ~Bwithins&(Nallsources-1)
tuple b3::lib::statlib::anova::Wcolumns = makelist(Bwithins,Nfactors+1)
list b3::lib::statlib::anova::Wscols = [0]
tuple b3::lib::statlib::anova::Bscols = makelist(Bbetweens+1,Nfactors+1)
tuple b3::lib::statlib::anova::Nwifactors = len(Wscols)
tuple b3::lib::statlib::anova::Nwlevels = N.take(N.array(Nlevels),Wscols)
tuple b3::lib::statlib::anova::Nbtwfactors = len(Bscols)
tuple b3::lib::statlib::anova::Nblevels = N.take(N.array(Nlevels),Bscols)
int b3::lib::statlib::anova::Nwsources = 2
 b3::lib::statlib::anova::Nbsources = Nallsources-Nwsources
tuple b3::lib::statlib::anova::M = pstat.collapse(data,Bscols,-1,None,None,mean)
tuple b3::lib::statlib::anova::Marray = N.zeros(Nblevels[1:],'f')
tuple b3::lib::statlib::anova::Narray = N.zeros(Nblevels[1:],'f')
list b3::lib::statlib::anova::idx = []
list b3::lib::statlib::anova::coefflist
int b3::lib::statlib::anova::dindex = 0
list b3::lib::statlib::anova::NDs = [0]
tuple b3::lib::statlib::anova::cdata = pstat.collapse(data,range(Nfactors+1),-1,None,None,mean)
int b3::lib::statlib::anova::dummyval = 1
tuple b3::lib::statlib::anova::datavals = pstat.colex(data,-1)
tuple b3::lib::statlib::anova::DA = N.ones(Nlevels,'f')
tuple b3::lib::statlib::anova::subjslots = N.ones((Nsubjects,1))
list b3::lib::statlib::anova::new = alluniqueslist[j]
tuple b3::lib::statlib::anova::btwidx = N.take(idx,N.array(Bscols))
int b3::lib::statlib::anova::dcount = 1
list b3::lib::statlib::anova::Bwsources = []
list b3::lib::statlib::anova::Bwonly_sources = []
tuple b3::lib::statlib::anova::D = N.zeros(Nwsources,N.PyObject)
list b3::lib::statlib::anova::DM = [0]
list b3::lib::statlib::anova::DN = [0]
float b3::lib::statlib::anova::dwsc = 1.0
tuple b3::lib::statlib::anova::Bnonsource = (Nallsources-1)
tuple b3::lib::statlib::anova::Bwscols = makebin(Wscols)
 b3::lib::statlib::anova::Bwithinnonsource = Bnonsource&Bwscols
tuple b3::lib::statlib::anova::Lwithinnonsource = makelist(Bwithinnonsource,Nfactors+1)
 b3::lib::statlib::anova::mns = dwsc
 b3::lib::statlib::anova::Bwithinsource = source&Bwscols
tuple b3::lib::statlib::anova::Lwithinsourcecol = makelist(Bwithinsource, Nfactors+1)
tuple b3::lib::statlib::anova::Lsourceandbtws = makelist(source | Bbetweens, Nfactors+1)
tuple b3::lib::statlib::anova::dvarshape = N.array(N.take(mns.shape,Lwithinsourcecol[1:]))
tuple b3::lib::statlib::anova::idxarray = N.indices(dvarshape)
tuple b3::lib::statlib::anova::newshape
tuple b3::lib::statlib::anova::indxlist = N.swapaxes(N.reshape(idxarray,newshape),0,1)
tuple b3::lib::statlib::anova::coeffmatrix = N.ones(mns.shape,N.Float)
tuple b3::lib::statlib::anova::Wsourcecol = makelist(Bwscols&source,Nfactors+1)
list b3::lib::statlib::anova::nlevels = coeffmatrix.shape[0]
list b3::lib::statlib::anova::nextcoeff = coefflist[nlevels-1]
 b3::lib::statlib::anova::scratch = coeffmatrix*mns
list b3::lib::statlib::anova::tmp = D[dcount]
list b3::lib::statlib::anova::variables = D[dcount]
tuple b3::lib::statlib::anova::tidx = range(1,len(subjslots.shape))
tuple b3::lib::statlib::anova::tsubjslots = N.transpose(subjslots,tidx)
tuple b3::lib::statlib::anova::DMarray
tuple b3::lib::statlib::anova::DNarray
tuple b3::lib::statlib::anova::loopcap = N.array(tsubjslots.shape[0:-1])
tuple b3::lib::statlib::anova::thismean
tuple b3::lib::statlib::anova::BNs = pstat.colex([Nlevels],Bscols[1:])
tuple b3::lib::statlib::anova::sourcecols = makelist(source-1,Nfactors+1)
tuple b3::lib::statlib::anova::Lsource = makelist((Nallsources-1)&Bbetweens,Nfactors+1)
 HERE BEGINS THE MAXWELL & DELANEY APPROACH TO CALCULATING SS.
tuple b3::lib::statlib::anova::btwcols = map(Bscols.index,Lsource)
tuple b3::lib::statlib::anova::hn = aharmonicmean(Narray,-1)
float b3::lib::statlib::anova::SSw = 0.0
tuple b3::lib::statlib::anova::idxlist = pstat.unique(pstat.colex(M,btwcols))
list b3::lib::statlib::anova::newval = row[-1]
tuple b3::lib::statlib::anova::btwsourcecols = (N.array(map(Bscols.index,Lsource))-1)
 b3::lib::statlib::anova::Bbtwnonsourcedims = ~source&Bbetweens
tuple b3::lib::statlib::anova::Lbtwnonsourcedims = makelist(Bbtwnonsourcedims,Nfactors+1)
tuple b3::lib::statlib::anova::btwnonsourcedims = (N.array(map(Bscols.index,Lbtwnonsourcedims))-1)
tuple b3::lib::statlib::anova::sourceMarray = amean(Marray,btwnonsourcedims,1)
 Average Marray over non-source dimensions (1=keep squashed dims)
tuple b3::lib::statlib::anova::sourceNarray = aharmonicmean(Narray,btwnonsourcedims,1)
 Calculate harmonic means for each level in source.
tuple b3::lib::statlib::anova::ga
 Calc grand average (ga), used for ALL effects.
float b3::lib::statlib::anova::sub_effects = 1.0
 Calc all SUBSOURCES to be subtracted from sourceMarray (M&D p.320)
 b3::lib::statlib::anova::effect = sourceMarray-sub_effects
 Calc this effect (a(j)'s, b(k)'s, ab(j,k)'s, whatever)
tuple b3::lib::statlib::anova::SS
 Save it so you don't have to calculate it again next time.
tuple b3::lib::statlib::anova::collapsed = pstat.collapse(M,btwcols,-1,None,len,mean)
 Save it so you don't have to calculate it again next time.
tuple b3::lib::statlib::anova::contrastmns = pstat.collapse(collapsed,btwsourcecols,-2,sterr,len,mean)
tuple b3::lib::statlib::anova::contrastns
tuple b3::lib::statlib::anova::contrasthns
tuple b3::lib::statlib::anova::sourceNs = pstat.colex([Nlevels],makelist(source-1,Nfactors+1))
tuple b3::lib::statlib::anova::dfnum = N.multiply.reduce(N.ravel(N.array(sourceNs)-1))
tuple b3::lib::statlib::anova::dfden = Nsubjects-N.multiply.reduce(N.ravel(BNs))
 b3::lib::statlib::anova::MS = SS/dfnum
 b3::lib::statlib::anova::MSw = SSw/dfden
 b3::lib::statlib::anova::f = MS/MSw
tuple b3::lib::statlib::anova::prob = fprob(dfnum, dfden, f)
tuple b3::lib::statlib::anova::sourcewithins = (source-1)
 RESTRICT COLUMNS/DIMENSIONS SPECIFIED IN source (BINARY) (i.e., is the value of source not equal to 0 or -1?)
list b3::lib::statlib::anova::workD = D[Bwonly_sources.index(sourcewithins)]
 Set up workD and subjslots for upcoming calcs.
tuple b3::lib::statlib::anova::ef = Dfull_model(workD,subjslots)
 Calculate full-model sums of squares.
tuple b3::lib::statlib::anova::er = Drestrict_mean(workD,subjslots)
list b3::lib::statlib::anova::p = workD.shape[1]
tuple b3::lib::statlib::anova::k = N.multiply.reduce(N.ravel(BNs))
int b3::lib::statlib::anova::m = 1
tuple b3::lib::statlib::anova::d_en = float(p**2 + (k-1)**2 - 5)
float b3::lib::statlib::anova::s = 1.0
tuple b3::lib::statlib::anova::lmbda = LA.determinant(ef)
tuple b3::lib::statlib::anova::W = math.pow(lmbda,(1.0/s))
string b3::lib::statlib::anova::suffix = ''
tuple b3::lib::statlib::anova::adjsourcecols = N.array(makelist(source-1,Nfactors+1))
string b3::lib::statlib::anova::thiseffect = ''
tuple b3::lib::statlib::anova::outputlist
tuple b3::lib::statlib::anova::prefixcols = range(len(collapsed[0][:-3]))
tuple b3::lib::statlib::anova::outlist = pstat.colex(collapsed,prefixcols)
list b3::lib::statlib::anova::eff = []
list b3::lib::statlib::anova::title = [['FACTORS: ','RANDOM'] + effects[:Nfactors]]
 OUTPUT FINAL RESULTS (ALL SOURCES TOGETHER) Note: All 3 types of source-calcs fall through to here.
list b3::lib::statlib::anova::facttypes = ['BETWEEN']
tuple b3::lib::statlib::anova::sourcebetweens = (source-1)
tuple b3::lib::statlib::anova::all_cellmeans = N.transpose(DM[dindex],[-1]+range(0,len(DM[dindex].shape)-1))
tuple b3::lib::statlib::anova::all_cellns = N.transpose(DN[dindex],[-1]+range(0,len(DN[dindex].shape)-1))
list b3::lib::statlib::anova::levels = D[dindex]
 DO SS CALCS ON THE OUTPUT FROM THE SOURCE=0 AND SOURCE=-1 CASES.
tuple b3::lib::statlib::anova::SSm = N.zeros((levels,levels),'f')
tuple b3::lib::statlib::anova::tworkd = N.transpose(D[dindex])
tuple b3::lib::statlib::anova::RSw = N.zeros((levels,levels),'f')
 Calculate SSw, within-subj variance (Lindman approach)
tuple b3::lib::statlib::anova::RSinter = N.zeros((levels,levels),N.PyObject)
list b3::lib::statlib::anova::cross = all_cellmeans[i]
tuple b3::lib::statlib::anova::multfirst = asum(cross*all_cellns[i])
list b3::lib::statlib::anova::sourceDMarray = DM[dindex]
 Average Marray over non-source dimensions.
tuple b3::lib::statlib::anova::sourceDNarray = aharmonicmean(DN[dindex],btwnonsourcedims,1)
 Calculate harmonic means for each level in source.
tuple b3::lib::statlib::anova::variableNs
 Calc grand average (ga), used for ALL effects.
tuple b3::lib::statlib::anova::subsourcebtw = (subsource-1)
 Make a list of the non-subsource dimensions.
tuple b3::lib::statlib::anova::sserr = N.zeros((levels,levels),'f')
tuple b3::lib::statlib::anova::ssval = N.add.reduce(workd[i]*workd[j])
list b3::lib::statlib::anova::mask = tsubjslots[idx]
 WHILE STILL MORE GROUPS, CALCULATE GROUP MEAN FOR EACH D-VAR.
list b3::lib::statlib::anova::thisgroup = tworkd*mask[N.NewAxis,:]
tuple b3::lib::statlib::anova::groupmns = amean(N.compress(mask,thisgroup),1)
tuple b3::lib::statlib::anova::errors = errors-N.multiply.outer(groupmns,mask)
 THEN SUBTRACT THEM FROM APPROPRIATE SUBJECTS.
 All Classes Namespaces Files Functions Variables Properties