suppose i have such dataset.
mydata=structure(list(x1 = 1:3, x2 = 1:3, x3 = 1:3, x4 = 1:3, x5 = 1:3,
x6 = 1:3), class = "data.frame", row.names = c(NA, -3L))
how to perform a regression by swapping the dependent and independent variables? For example we can create models like
mymodel1=lm(x1~x2,data=mydata)
оr
x3~x5
or
x5~x1
and so on also i can combinate predcitors.For example
mymod=lm(x1~x2+x6+x5)
or
mymod2=lm(x3~x2+x4+x5)
and so on
is there way to perform multiply regressions models in R via combining variables (dependent-independent(s)?