statsmodels.sandbox.stats.multicomp.StepDown¶
-
class
statsmodels.sandbox.stats.multicomp.
StepDown
(vals, nobs_all, var_all, df=None)[source]¶ a class for step down methods
This is currently for simple tree subset descend, similar to homogeneous_subsets, but checks all leave-one-out subsets instead of assuming an ordered set. Comment in SAS manual: SAS only uses interval subsets of the sorted list, which is sufficient for range tests (maybe also equal variance and balanced sample sizes are required). For F-test based critical distances, the restriction to intervals is not sufficient.
This version uses a single critical value of the studentized range distribution for all comparisons, and is therefore a step-down version of Tukey HSD. The class is written so it can be subclassed, where the get_distance_matrix and get_crit are overwritten to obtain other step-down procedures such as REGW.
iter_subsets can be overwritten, to get a recursion as in the many to one comparison with a control such as in Dunnet’s test.
A one-sided right tail test is not covered because the direction of the inequality is hard coded in check_set. Also Peritz’s check of partitions is not possible, but I have not seen it mentioned in any more recent references. I have only partially read the step-down procedure for closed tests by Westfall.
One change to make it more flexible, is to separate out the decision on a subset, also because the F-based tests, FREGW in SPSS, take information from all elements of a set and not just pairwise comparisons. I haven’t looked at the details of the F-based tests such as Sheffe yet. It looks like running an F-test on equality of means in each subset. This would also outsource how pairwise conditions are combined, any larger or max. This would also imply that the distance matrix cannot be calculated in advance for tests like the F-based ones.
Methods
check_set
(indices)check whether pairwise distances of indices satisfy condition
get_crit
(alpha)get_tukeyQcrit
studentized range statistic
iter_subsets
(indices)Iteratre substeps
run
(alpha)main function to run the test,
stepdown
(indices)