I understand that PICs are normally only used for continuous traits. However, on this how-to site (https://www.r-phylo.org/wiki/HowTo/Phylogenetic_Independent_Contrasts) there is mention of "Discrete traits can be coded as continuous variables (see ?contr.treatment) and analysed as usual, if they are independent (explanatory) variables."

However, I'm having trouble understanding the commands described in ?contr.treatment and how they relate at all to using discrete traits in PICs. I assume it is a way to transform discrete into continuous data (or at least the appearance of cont. data) so as to perform the PIC, but I don't know how to get there from that hint.

This would very much help analyze my data, which includes both continuous and discrete data. I've already performed a phylogenetic logistic regression, but I feel that PICs could help cement my case if possible to perform.


Assuming that by "discrete", you mean "discrete and ordinal" (like 2, 21, 7, 12) and not "discrete and nominal" (like red, blue, yellow, green), then it is really easy. It just mean you can just use your numbers. The contrast between lineage with average trait 6 and lineage with average trait 9, the contrast is therefore 3.

If your data are nominal, then there is no way to calculate a contrast.

Not however, that typically you might violate assumptions of the PIC model. Make sure to know those assumptions and have a feel of whether you seem to respect them.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.