I am trying to do a regression with multiple dependent variables and multiple independent variables. Basically I have House Prices
at a county level for the whole US, this is my IV. I then have several other variables at a county level (GDP
, construction employment
), these constitute my dependent variables. I would like to know if there is an efficient way to do all of these regressions at the same time. I am trying to get:
lm(IV1 ~ DV11 + DV21)
lm(IV2 ~ DV12 + DV22)
I would like to do this for each independent and each dependent variable.
EDIT: The OP added this information in response to my answer, now deleted, which misunderstood the question.
I don't think I explained this question very well, I apologize. Every dependent variable has 2 independent variables associated with it, that unique. So if I have 500 dependent variables, I have 500 unique independent variable 1, and 500 unique independent variable 2.
Ok, I will try once more, if I fail to explain myself again I may just give up (haha). I don't know what you mean by mtcars
from R though [this is in reference to Metrics's answer], so let me try it this way. I'm going to have 3 vectors of data roughly 500 rows in each one. I'm trying to build a regression out of each row of data. Let's say vector 1 is my dependent variable (the one I'm trying to predict), and vectors 2 and 3 make up my independent variables. So the first regression would consist of the row 1 value for each vector, the 2nd would consist of the row 2 value for each one and so on. Thank you all again.
lm(DV ~ IV)
). – gung - Reinstate Monica