is there a way to make all variables a target variable and check regression results against other independent variables. For example
df
Date Var1 Var2 Var3
27/9/2019 12 45 59
28/9/2019 34 43 54
29/9/2019 45 23 40
Usually if want to see the relationship between Var1 and Var2 i use below code
lm(Var1 ~ Var2, data = myData)
In case I want to see the results for all variables (Var1 , Var2 and Var3) like, in one instance, Var1 is dependent variable and rest(Var2 and Var3) are independent. Then 2 instance, Var2 is dependent variable and rest(Var1 and Var3) are independent and so on. Is there a way to do this?