R, Statistics, Data Science.
above. To calculate these matrices, first split the data into a list by group and find the mean vectors of each group. The sample sizes n_i of each group, and the total mean vector will also be required. root.group <- split(root[,2:5], root$Tree.Number) root.means <- sapply(root.group, function(x)