Using univariate analysis

Is there any way of using statistics tool from script level? I was studying API with no luck in this matter