stats homework using R