Hi R-programmers ! I would like to perform a linear model regression month by month using the 'lm' function and i don't know how to do it.
The data is organised as below: Month ExcessReturn Return STO 8 0.047595875 0.05274292 0.854352503 8 0.016134874 0.049226941 4.399372005 8 -0.000443869 0.004357305 -1.04980297 9 0.002206554 -0.089068828 0.544809429 9 0.021296551 0.003795071 0.226875834 9 0.006741578 0.014104606 0.721986383 the model is: ExcessReturn= a + b1*Return + b2*STO + u, u is the error term, a is the intercept. I would like to get two vectors of estimates (each of them containing the estimation of b1 and b2) using the least squares estimation. I tried it using 'aggregateè but it didn't seem to work. Thank you for your help ! [[alternative HTML version deleted]]
______________________________________________ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.