cs <- c(23, 19, 30, 22, 23, 29, 35, 36, 33, 25) ts <- c(430, 430, 333, 410, 390, 377, 325, 310, 328, 375) mod <- lm(ts ~ cs) # compute the SSR and save it to `ssr` # compute the TSS and save it to `tss` # compute the SSR and save it to `ssr` ssr <- sum(mod$residuals^2) # compute the TSS and save it to `tss` tss <- 9*var(ts) # Note: `var()` computes the unbiased sample variance! => correct for this by multiplying with (n-1) = 9 test_predefined_objects("mod") test_object("ssr") test_object("tss")