  An important problem in evolutionary genomics is to investigate whether a
certain trait measured on each sample is associated with the sample
phylogenetic tree. The phylogenetic tree represents the shared evolutionary
history of the samples and it is usually estimated from molecular sequence data
at a locus or from other type of genetic data. We propose a model for trait
evolution inspired by the Chinese Restaurant Process that includes a parameter
that controls the degree of preferential attachment, that is, the tendency of
nodes in the tree to subtend from nodes of the same type. This model with no
preferential attachment is equivalent to a structured coalescent model with
simultaneous migration and coalescence events and serves as a null model. We
derive a test for phylogenetic binary trait association with linear
computational complexity and empirically demonstrate that it is more powerful
than some other methods. We apply our test to study the phylogenetic
association of some traits in swordtail fish, breast cancer, yellow fever virus
and influenza A H1N1 virus. R package implementation of our methods is
available at $\texttt{https://github.com/jyzhang27/CRPTree}$.
