I'm an R beginner and I have a large dataset containing skeletal measurements for mammals, such as femur length, cranial length, lower tooth row length, and more. Each animal is also associated with various categories, including locomotory type and diet. My goal is to automate the process of performing linear regressions in R to identify the measurements that serve as the strongest predictors of body mass.
In this dataset, I have 46 different measurements, and I'm also interested in exploring combinations of certain measurements (e.g., humerus circumference + femur circumference) as predictors. Additionally, I want to take into account the categorical variables, such as diet, which might influence specific predictors only (e.g. dental morphology).
Could you please provide guidance on how to automate this process in R? Specifically, I would like to know how to:
- Iterate through the measurements and combinations to perform OLS and SMA regressions.
- Assess the strength of each regression model to determine the strongest predictors of body mass.
- Consider the impact of categorical variables within the regression analysis.
I have considered using regression trees but I'm not sure that would be the best way to proceed. If possible, I would appreciate any suggested approaches to help me get started. Thank you in advance for your help!