Skip to content
DeepForgeby svx
All problems
EasyStatisticsst-019

Standard Error of the Mean

Problem

Return the standard error s / sqrt(n), where s is the sample standard deviation with denominator n - 1. Return 0.0 when n < 2 or the sample variance is zero.

Hint

Sample variance uses n - 1, then divide its square root by sqrt(n).

Test cases

case 1
in: [[1,2,3,4,5]]
expected: 0.7071067811865476
case 2
in: [[2,4,4,4,5,5,7,9]]
expected: 0.7559289460184544
case 3
in: [[5]]
expected: 0
case 4
in: [[]]
expected: 0
case 5
in: [[1,3]]
expected: 1
Starter codePython
def standard_error(data):
    # Your code here
    pass

5 test cases · run your code against them in the editor