def ModeratedWelchTest(gs,d0,s0_squared): df = gs.DF() ### use the s0_squared for the pairwise comparison calculated in the getModeratedStandardDeviation svar1 = (d0*s0_squared+df*gs.Svar1())/(d0+df) svar2 = (d0*s0_squared+df*gs.Svar2())/(d0+df) #svar = sg ### Use this to test and see if this gives the same result as a non-moderated t-test if svar1 != 0 and svar2 != 0: t = (gs.Avg1()-gs.Avg2())/math.sqrt(svar1+svar2) prob = salstat_stats.betai(0.5*df,0.5,float(df)/(df+t*t)) else: prob = 1 #gs.SetAdjP(prob) gs.setPval(prob)
def incompleteBeta(t,df): p = salstat_stats.betai(0.5*df,0.5,df/(df+t*t)) return p