variable_summary function

Computes mean and optional probabilities for a given variable.