average kinetic energy/bin getting proportional to number density

Dear all

I am trying to get a temperature profile across the liquid- vapor interface. For that i am finding the kinetic energy/bin as ouput and then manually calculating temperature/bin.While getting the kinetic energy ,it is always found to be proportional to number density.I have used the following compute and fix command.Is there any other method for finding average temperature or kinetic energy/bin.
kindly help me to get the same. Thanks in advance.
Jesseela
compute perke all ke/atom
fix ke all ave/spatial 2 500 1000 z lower 0.05 c_perke ave running units reduced file ken3water.xls

Could you attach your full input script and any data files, as well as an example temperature profile (if you have one)? Those two lines aren't much to go off.