You haven't said much about your physical setup or shown your code, so we don't know very much, but I'll take a guess.
Let's say you are turning the encoder shaft by hand. If you turn it clock-wise, you get an increasing count, and if you turn it counter-clockwise, you get a decreasing count. It's an incremental encoder, so it's not really giving you absolute position. It's giving you counts, which is how much it has rotated. If you get 800 counts/per, then after 1 rev you'll be at 800, and if you keep going another rev you'll be at 1600, etc.
Speed is change in position per unit time. Let's assume you read the encoder position every 1 ms (0.001 sec). If the encoder counts at t=0 is X, and counts at time t=1 ms is Y, the change in position is Y-X (counts) and the speed in RPM is ((Y-X)/0.001) * (60/800). If all you want to do is make the stepper motor move the same as the encoder, you don't need speed. You only need the encoder counts. If you are reading the encoder position every 1 ms, you simply compute the change in position since the last read (can be positive or negative), and then command the stepper motor to move the same number of steps. If 1 ms is too frequent, slow it down to every 10 or 100 ms.