Re: Altair personal slc: Slope Function
Calculate slope based on current and previous points
https://community.altair.com/discussion/comment/197257
Note that the value of the natural exponential function is unique
in that the derivative(point slope) is equal to itself.
Makes checking easy
/--- create input data two columns x and exp(x) natural exponential function ---/
data series;
do x=0 to .1 by .01;
y=exp(x);
output;
end;
run;
/--- compute the slope ---/
data slope;
set series;
slope=dif(y)/dif(x);
run;quit;
/--- output ---/
proc print noobs data=slope;
run;
X Y SLOPE
0.000 1.00000 .
0.001 1.00100 1.00050
0.002 1.00200 1.00150
0.003 1.00300 1.00250
0.004 1.00401 1.00351
0.005 1.00501 1.00451
0.006 1.00602 1.00552
0.007 1.00702 1.00652
0.008 1.00803 1.00753
0.009 1.00904 1.00854
0.010 1.01005 1.00955