Calculate stats using R functions; accept model file or real data CSV as input