Lets say I have a phylogenetic tree and two traits A and B mapped to the tips of the tree, and I want to test the hypothesis that evolution of trait B is contingent on trait A having certain states. For example, if A and B have two possible states, 0 and 1, then, how would be the best way to test that the transition B:0->1 is contingent (or more likely to occur) on A being on state 1?