computing linear regression and -squared using python let' now play with linear regression and actually compute some linear regression and rsquared we can start by creating little bit of python code here that generates some random-ish data that is in fact linearly correlated in this example ' going to fake some data about page rendering speeds and how much people purchasejust like previous example we're going to fabricate linear relationship between the amount of time it takes for website to load and the amount of money people spend on that websitenbuqmpumjcjomjof jnqpsuovnqzbtoq gspnqzmbcjnqpsu qbhf qffet oqsboepnopsnbm qvsdibtf"npvou qbhf qffet oqsboepnopsnbm  tdbuufs qbhf qffetqvsdibtf"npvou all 've done here is 've made randoma normal distribution of page speeds centered around seconds with standard deviation of second 've made the purchase amount linear function of that soi' making it minus the page speeds plus some normal random distribution around ittimes and if we scatter thatwe can see that the data ends up looking like this