title: How can I perform and store linear regression models between all continuous variables in a data frame?
body: <p>Let's say I'm using <code>mtcars</code> in R and I want to perform linear regressions between all possible combinations of numeric variables, and store them (in a list or maybe a different data structure if there's a better one). How would I accomplish that? I've seen similar posts like <a href="https://stackoverflow.com/questions/42464767/how-to-run-lm-regression-for-every-column-in-r">this one</a>, but this approach only runs regressions with col1 against col2, col1 against col3 ...etc. I want a solution that also runs regressions between col2 and col3 (i.e. all pairwise comparisons). Any help would be greatly appreciated.</p>