I have a dataset (data frame) with 5 columns all containing numeric values.
I'm looking to run a simple linear regression for each pair in the dataset.
For example, If the columns were named A, B, C, D, E, I want to run lm(A~B), lm(A~C), lm(A~D), ...., lm(D~E),... and, then I want to plot the data for each pair along with the regression line.
我对R很陌生,所以我在如何实现这一目标的过程中如何旋转.我应该用ddply吗?还是lapply?我真的不确定如何解决这个问题.