All problems
One Sample Z Statistic from Mean
Problem
For known standard deviation sigma, the one-sample z statistic is (xbar - mu0) / (sigma / sqrt(n)).
Given the sample mean, the hypothesized mean, sigma, and n, return the z statistic.
Hint
Standardize the difference by the standard error of the mean.
Test cases
case 1
in: [5.5,5,1,25]
expected: 2.5
case 2
in: [0,1,2,4]
expected: -1
case 3
in: [10,10,3,9]
expected: 0
Starter codePython
def one_sample_z_statistic_from_mean(xbar, mu0, sigma, n):
# Your code here
pass3 test cases · run your code against them in the editor