Models of trait evolution form an important part of macroevolutionary biology. The Brownian motion model and Ornstein-Uhlenbeck models have become classic (null) models of character evolution, in which species evolve independently. Recently, models incorporating species interactions have been developed, particularly involving competition where abiotic factors pull species toward an optimal trait value and competitive interactions drive the trait values apart. However, these models assume a fitness function rather than derive it from population dynamics and they do not consider dynamics of the trait variance. Here we develop a general coherent trait evolution framework where the fitness function is based on a model of population dynamics, and therefore it can, in principle, accommodate any type of species interaction. We illustrate our framework with a model of abundance-dependent competitive interactions against a macroevolutionary background encoded in a phylogenetic tree. We develop an inference tool based on Approximate Bayesian Computation and test it on simulated data (of traits at the tips). We find that inference performs well when the diversity predicted by the parameters equals the number of species in the phylogeny. We then fit the model to empirical data of baleen whale body lengths, using three different summary statistics, and compare it to a model without population dynamics and a model where competition depends on the total metabolic rate of the competitors. We show that the unweighted model performs best for the least informative summary statistic, while the model with competition weighted by the total metabolic rate fits the data slightly better than the other two models for the two more informative summary statistics. Regardless of the summary statistic used, the three models substantially differ in their predictions of the abundance distribution. Therefore, data on abundance distributions will allow us to better distinguish the models from one another, and infer the nature of species interactions. Thus our framework provides a conceptual approach to reveal species interactions underlying trait evolution and identifies the data needed to do so in practice.,The derivation of the model is in Supplementary_material_of_Inferring_the_effect_of_species_interactions_on_trait_evolution.pdf in the attachments.,Supplementary results Figures S2-S16. Trait trees under different parameter combinations of Scenarios 1, 2, 3 under the AWC model and the UWC model for the tree values of scaling parameters, s=100,1000,10000. For the figures of the rest of the secenarios, they are stored in the folder “abundance_test.” Figures S17-S18. Trait trees under different parameter combinations of different scenarios. Figures S19-S21. Prediction of the abundance distribution versus body length across 1000 simulations using the estimated parameters for Scenarios 1-3. For the figures of the rest of the scenarios, they are stored in the folder “PredictionDis.” Figures S22-S24. Predictions of the trait variance distribution across 100 simulations using the estimated parameters for Scenarios 1-3. For the figures of the rest of the scenarios, they are stored in the folder “PredictionDis.” Figures S25-S27. Comparison of the parameter estimates for those generating parameters for which the ratio \frac{\sqrt{\alpha/\gamma}}{\text{Richness}} is in the range of (0.5,1.5). The figures of other scenarios are stored in the folder “Estimation.” Figures S28-S58. Comparison of the estimates among different scenarios. Figures S59-S60. Parameter estimates under PICs and UMTD+PICs for the AWC model on the logtransformed body length. Figures S61-S63. Parameter estimates under SMTD, PICs and UMTD+PICs for the AWC model on the untransformed body length. Figures S64-S66. Results of the model comparison analysis on the untransformed body length. Figures S67-S69. Results of the model comparison analysis on the logtransformed body length. Figure S70. Abundance distributions of the AWC and MWC models. Figure S71. Trait variance distributions of the AWC and MWC models. Figures S72-74. Distribution of the goodness-of-fit of the three models using three summary statistics. The red dashed line represents the 5% best GOF-values. Figure S75. The predicted contrasts using the estimated parameters under the three models and the true contrasts for PICs. Figure S76. The predicted contrasts using the estimated parameters under the three models and the true contrasts for UMTD+PICs. Phylogenetic tree data for Scenarios 1-22. They are stored in the folder “SimTreeInfo” and indexed accordingly. All the data of generated trees used in the simulation study (Scenarios 1-22) are stored in the folder “SimTreeInfo.” The inference results of the simulation study are stored in the folder “SimEstResults.” The baleen whale data and results are stored in the folder “BaleenWhaleData&Results.”,