func variance(data []int) float64 {
	return meanFloat(getSquaredDifferences(data))
}
variance is the mean of the squared differences between each observed
point and the mean (xbar)
package tabular
import (
	log "github.com/Sirupsen/logrus"
	"math"
	"regexp"
)
func meanInt(data []int) float64 {
	sumInt := func(data []int) (sum int) {
		for _, i := range data {
			sum += i
		}
		return sum
	}
	return float64(sumInt(data)) / float64(len(data))
}
func meanFloat(data []float64) float64 {
	sumFloat := func(data []float64) (sum float64) {
		for _, i := range data {
			sum += i
		}
		return sum
	}
	return sumFloat(data) / float64(len(data))
}
func getSquaredDifferences(data []int) (sqrDiffs []float64) {
	xbar := meanInt(data)
	for _, xn := range data {
		sqrDiff := math.Pow((xbar - float64(xn)), 2)
		sqrDiffs = append(sqrDiffs, sqrDiff)
	}
	return sqrDiffs
}