How do I get rid of units in values so they are treated as numbers?

Suppose the attribute that has units is named Distance. Define a new attribute named NewDistance and give it the formula stringToNumber ( Distance).

Clear the formula for NewDistance and delete the Distance attribute. Finally, rename NewDistance to Distance.

The values in the Distance attribute are now all numbers and you can plot them as such or compute measures such as mean and standard deviation from them.