Hello Group,
I would request your help to build a shell script that can calculate the beta or slope between a two series of investment instruments (i.e S&P 500 and Silver).
I have a source files of data (First - Date, Second (Value1) and Third (Value 2) columns)
Date S&P 500 S&P 500 Silver Silver
9/4/2012 140.28 31.36
9/5/2012 140.16 -0.085616438 31.27 -0.287815798
9/6/2012 143.01 1.992867632 31.67 1.263024945
9/7/2012 143.56 0.383115074 32.64 2.971813725
9/10/2012 142.75 -0.567425569 32.29 -1.083926912
9/11/2012 143.15 0.279427174 32.41 0.370256094
9/12/2012 143.62 0.327252472 32.21 -0.620925179
9/13/2012 145.81 1.501954598 33.61 4.165426956
9/14/2012 146.46 0.443807183 33.6 -0.029761905
9/17/2012 145.96 -0.342559605 32.99 -1.849045165
9/18/2012 145.84 -0.082281953 33.71 2.135864729
9/19/2012 145.92 0.054824561 33.57 -0.417039023
9/20/2012 145.93 0.006852601 33.58 0.029779631
9/21/2012 145.87 -0.041132515 33.48 -0.298685783
9/24/2012 145.65 -0.151047031 32.93 -1.670209535
9/25/2012 144.1 -1.075641915 32.68 -0.76499388
9/26/2012 143.29 -0.56528718 32.87 0.578034682
9/27/2012 144.64 0.93335177 33.58 2.114353782
9/28/2012 143.97 -0.465374731 33.48 -0.298685783
Slope or Beta 0.293057926
Attached you will find the spreadsheet of this example
Thanks in advance