All problems
Standard Error of Fitted Mean
Problem
The standard error of the estimated mean response at x is s * sqrt(1/n + (x - xbar)^2 / Sxx).
Given the residual standard deviation s, the sample size, the value x, xbar, and Sxx, return the standard error.
Hint
The uncertainty grows as the query point moves from the center.
Test cases
case 1
in: [1,10,5,5,10]
expected: 0.31622776601683794
case 2
in: [2,20,8,5,16]
expected: 1.5652475842498528
case 3
in: [0.5,5,1,1,4]
expected: 0.22360679774997896
Starter codePython
def standard_error_of_fitted_mean(s, n, x, xbar, sxx):
# Your code here
pass3 test cases · run your code against them in the editor