started writing statistics code in R