def multicontrast_pvalues(tstat, tcorr, df=None, dist='t', alternative='two-sided'):
 from statsmodels.sandbox.distributions.multivariate import mvstdtprob
 if ((df is None) and (dist == 't')):
  raise ValueError('df has to be specified for the t-distribution')
 tstat = np.asarray(tstat)
 ntests = len(tstat)
 cc = np.abs(tstat)
 pval_global = (1 - mvstdtprob((- cc), cc, tcorr, df))
 pvals = []
 for ti in cc:
  limits = (ti * np.ones(ntests))
  pvals.append((1 - mvstdtprob((- cc), cc, tcorr, df)))
 return (pval_global, np.asarray(pvals))

def multicontrast_pvalues ( tstat , tcorr , df = None , dist = 't' , alternative = 'two-sided' ) : from statsmodels . sandbox . distributions . multivariate import mvstdtprob if ( ( df is None ) and ( dist == 't' ) ) : raise ValueError ( 'df has to be specified for the t-distribution' ) tstat = np . asarray ( tstat ) ntests = len ( tstat ) cc = np . abs ( tstat ) pval_global = ( 1 - mvstdtprob ( ( - cc ) , cc , tcorr , df ) ) pvals = [ ] for ti in cc : limits = ( ti * np . ones ( ntests ) ) pvals . append ( ( 1 - mvstdtprob ( ( - cc ) , cc , tcorr , df ) ) ) return ( pval_global , np . asarray ( pvals ) )
pvalues for simultaneous tests .