Peter K. answered 12/06/19
Math / Statistics / Data Analytics
# write down x's and y's
x <- c(20, 25, 23, 19)
y <- c(10, 15, 12, 10)
# calculate their means:
mean_x = mean(x)
mean_y = mean(y)
mean_x
ans: 21.75
mean_y
ans: 11.75
#calculate the differences between the means and the individual values
x-mean_x
ans: -1.75 3.25 1.25 -2.75
y-mean_y
ans: -1.75 3.25 0.25 -1.75
#calculate the square of the differences between the means and the individual values
(x-mean_x)^2
ans: 3.0625 10.5625 1.5625 7.5625
(y-mean_y)^2
3.0625 10.5625 0.0625 3.0625
# add them up
SS_x = sum((x-mean_x)^2)
SS_y = sum((y-mean_y)^2)
# so these values should be your sum of squares of x and y
SS_x
ans: 22.75
SS_y
ans: 16.75