Running linear regression on each attribute X_i in example set and Age (also in example set)
Hi,
I have an example set with +/- 300 numerical attributes X_i and an attribute "age". I'd like to know if any of the attributes X_i can be predicted by age. For this, I'd like to run a simple linear regression with age as the independent variable (x-axis) and X_i as the dependent variable (y-axis). I'd like to run this regression on each attribute X_i in the example set using some loop operator.
I tried using the "Loop Attributes" operator on just the subset X_i's but I cannot find a way to "inject" the Age attribute as a fixed and unchanging 2nd attribute inside the operator. Perhaps there's a way to do this with macro's but I'm not sure how to do that. So, in each loop iteration I would like to access attribute X_i and Age. X_i changes with the loop index. Age stays the same.
Any help would be greatly appreciated!
Ralph
Best Answer
-
ralph_brecheise Member Posts: 17 Maven
Hi Scott,
Thanks for the quick reply. I'll give it a try!
Ralph
1
Answers
hi @ralph_brecheise - yes Loop Attributes with macros will do this nicely. I am attaching a process for you to look at using the Sonar data set.
FWIW you may just want to use the Correlation Matrix operator and look at pairwise r values if that's sufficient. Much easier than full lin reg models!
Scott