Brooke, The MS slope formula is for the least square line thru the last 14 points. For y = a + b*x, the LS slope, b, is given by b = (S*Sxy -Sx*Sy)/(S*Sxx -Sx*Sx), where S = # of Points, Sx = sum(x), etc. This translates to the scan given below for R2.
Bob -------- output = "slope.lst"; issuetype common; Daystoload = 50; //needed for R2 bug!!! integer i, S, Sx, Sxx; float b, Sxy, Sy; S := 14; Sx := 0; Sxx := 0; Sxy := 0; Sy := 0; for i = 1 - S to 0 do Sx := Sx + i; Sy := Sy + close(i); //kills println wo d2ld Sxx := Sxx + i*i; Sxy := Sxy + i*close(i); //kills println wo d2ld //Sxy := Sxy + i*close(0); next i; b := (S*Sxy - Sx*Sy)/(S*Sxx - Sx*Sx); println symbol,",",close(0):8:2,",",b:8:2; |