With this date frame I need to run some regressions. I want to do regressions with terms that are high to 3 and out of date.
I searched the lm package and could not implement it.
I want to, for example, rotate the first column in logarithm against the 2nd, 3rd and 4th column squared plus the lagged term of the first column.
AnoTrimestreLAG1 ENGTrimestralemT ENGTrimestralemLAG1 CotatoTrimestralemLAG1 CotatodTrimestralLAG12
2 2014-12-31 0.7695652 0.9367866 -1.6 2.56
3 2014-09-30 0.9367866 1.7134771 -0.2 0.04
4 2014-06-30 1.7134771 2.7852691 -0.6 0.36
5 2014-03-31 2.7852691 2.9320260 -1.2 1.44
6 2013-12-31 2.9320260 3.1011732 2.7 7.29
7 2013-09-30 3.1011732 2.7699729 2.1 4.41
How can I implement? can I do a function that does this? Any tip would be enough.
Thank you.