# What does the residuals effectively mean in this model?

I'm doing sme test using R and linear models.

This is the code I'm using:

> a
[1] 0.10 0.05 0.02 0.04 0.09 0.05
> b
[1] 0.07 0.02 0.08 0.02 0.01 0.06
> c
[1] 0.03 0.03 0.01 0.05 0.06 0.09
>
> r.a
[1] 0.10 0.15 0.17 0.21 0.30 0.35
> r.b
[1] 0.07 0.09 0.17 0.19 0.20 0.26
> r.c
[1] 0.03 0.06 0.07 0.12 0.18 0.27
>
> mod = lm(r.a ~ r.b + r.c + 0)
>
> mod

Call:
lm(formula = r.a ~ r.b + r.c + 0)

Coefficients:
r.b     r.c
0.8764  0.5231

> mod$residuals 1 2 3 4 5 6 0.02295527 0.03973251 -0.01561396 -0.01929937 0.03054829 -0.01912000 > > mean(mod$residuals)
[1] 0.006533791


The three serie above (a, b, c) are the returns of three stocks, and r.a, r.b, r.c are the cumulative returns cumsum(a) cumsum(b) cumsum(c)

Now, as you can see I have used the lm function to calculate the linear model, at the end of the code there are the residuals of this linear model. I need to understand what those number effectively mean. In other words... I used the returns of these three serie, so are the residuals the difference of the percentage of return ?

I try to exlpain in with an example:

Take a look at the third value of each series(cumulative returns)

Example:

r.a[3] - 0.17
r.b[3] - 0.17
r.c[3] - 0.07


And the third residual is: -0.01561396

Does it mean that there is a variation of 1% ? (0.01 = 1% 0.1 = 10% 1 = 100%)

And the second question is:

What is the relathionship between the residuals and the mean of the residuals?

Example: - the third residual is: -0.01561396 - the mean is 0.006533791

Can I say THIS (third) residual is around 1% far from the mean? With this I mean...IF those three stocks(the returns of those three stocks) are moving and the spread goes to (~0.006533791) the total return of this movement is 1% ?

Thank you!

-
I don't quite understand what is going on here, so won't post an "answer". But I think the answer to your first question "are the residuals the difference of the percentage of return" is "no". I suggest you have a re-think of what your model is doing - looking to see if there is a linear relationship between the cumulative sum of the return on one stock and the cumulative sum of the returns on two others. I don't think this is anything at all to do with what your questions are asking so you will probably want to go back to square one. –  Peter Ellis Apr 30 '12 at 10:25
@PeterEllis thank you for the comment. I need to study the relathionship of two stocks, but AFTER checking the residuals I need to know what is the distance from their mean, I only know the residuals (this is the only data i have) and now i need to calculate How far is the mean from thei relathionship... –  Dail Apr 30 '12 at 10:41
if all you have is the residuals from this particular model, I doubt you can find out much of interest. –  Peter Ellis Apr 30 '12 at 10:47
Also, don't you have three stocks, not two? –  Peter Ellis Apr 30 '12 at 10:48
@PeterEllis yes i have three stocks....and from residuals i need to calculate how much (%) is far form the mean(residuals) –  Dail Apr 30 '12 at 11:04