I have five data frames among which I want to run regressions:
- df1: stock returns
- df2: housing returns
- df3: actual inflation rate
- df4: expected inflation rate
- df5: unexpected inflation rate
Dataframe example
Each of the data frames has the same format as above, with only different data inside it.
I want to do separate regression of housing and stocks against expected and unexpected inflation as below:
df1[i] ~ df4[i] + df5[i]
df2[i] ~ df4[i] + df5[i]
I want to compare the results of regression for periods where actual inflation (included in df3) is higher than the median value with periods where actual inflation is lower than the median value. For doing that, I need to create two subsamples from each data frame based on the value that each column has in df3. Since I don't have a deep knowledge of R, I don't know how to do it. Is it possible to do it? and how? Or is it better to create 13 different data frames for each country?
Thank you in advance!