Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1# -*- coding: utf-8 -*- 

2""" 

3 

4Created on Fri Mar 30 18:27:25 2012 

5Author: Josef Perktold 

6""" 

7 

8from statsmodels.sandbox.stats.multicomp import ( # noqa:F401 

9 tukeyhsd, MultiComparison) 

10 

11__all__ = ['tukeyhsd', 'MultiComparison'] 

12 

13 

14def pairwise_tukeyhsd(endog, groups, alpha=0.05): 

15 """ 

16 Calculate all pairwise comparisons with TukeyHSD confidence intervals 

17 

18 Parameters 

19 ---------- 

20 endog : ndarray, float, 1d 

21 response variable 

22 groups : ndarray, 1d 

23 array with groups, can be string or integers 

24 alpha : float 

25 significance level for the test 

26 

27 Returns 

28 ------- 

29 results : TukeyHSDResults instance 

30 A results class containing relevant data and some post-hoc 

31 calculations, including adjusted p-value 

32 

33 Notes 

34 ----- 

35 This is just a wrapper around tukeyhsd method of MultiComparison 

36 

37 See Also 

38 -------- 

39 MultiComparison 

40 tukeyhsd 

41 statsmodels.sandbox.stats.multicomp.TukeyHSDResults 

42 """ 

43 

44 return MultiComparison(endog, groups).tukeyhsd(alpha=alpha)