This code should give you some ideas. The column formula makes use of the LAG function:
dt = open("$sample_data\Big Class.jmp");
// Create formula column
// Height = X
// Weight = Y
// dy/dx = (y+1) - (y-1)/(x+1) - (x-1)
// y+1: lag(:weight, -1)
// y-1: lag(:weight, 1)
// x+1: lag(:height, -1)
// x-1: lag(:height, 1)
dt << New Column( "dy/dx",
Numeric,
Continuous,
Format( "Best", 12 ),
Formula( lag(:weight, -1) - lag(:weight, 1) / lag(:height, -1) - lag(:height, 1))
);