* * * * Week 9 * * *Load data, file -> import -> ASCII data created by spreadsheet * *insheet using FTSE100.csv * *Processing data rename v1 price generate time = _n ** flip around dimension gen time2 = 6978 - time drop time rename time2 time tsset time *Generate returns generate returns = price/L.price -1 generate lnreturns = ln(price/L.price) *Graph returns twoway (line returns time, yaxis(2)) (line lnreturns time, yaxis(2)) twoway (line price time) *Histograms with densities twoway (histogram price) (kdensity price) twoway (histogram lnreturns) (kdensity lnreturns) *install module for cdfplot ssc install cdfplot cdfplot lnreturns,normal *Manual generation of normal distribution su lnreturns gen normalLogReturns= 0.0002308+ 0.0113213* invnorm(uniform()) su normalLogReturns *Plot to see difference in densities twoway(kdensity normalLogReturns ) (kdensity lnreturns ) *Autocorrelation function ac lnreturns, recast(connected) *Checking absolute returns gen abslnreturns = abs(lnreturns) ac abslnreturns, recast(connected) *Skewness test for normality *high joing prob, do not reject -> normally distributed sktest lnreturns