Advanced statistics using R