All problems
Trim-and-Fill Lite
Problem
Return a simplified trim-and-fill adjusted mean: compute the fixed-effect pooled mean, count studies below and above it, remove the excess studies from the majority side (the most extreme ones), and recompute the pooled mean. Return 0.0 when fewer than two studies are given, any se <= 0, or the kept set is empty.
Hint
Trimming the excess on one side of the funnel shifts the pooled estimate.
Test cases
case 1
in: [[1,1.2,1.4,0.8,0.9],[0.1,0.1,0.1,0.1,0.1]]
expected: 1.1249999999999998
case 2
in: [[1,1.2,1.4],[0.1,0.1,0.1]]
expected: 1.2
case 3
in: [[5,5,5],[0.1,0.2,0.3]]
expected: 5
case 4
in: [[0.1,0.2],[0.1,0.1]]
expected: 0.15000000000000002
case 5
in: [[],[]]
expected: 0
Starter codePython
def trim_and_fill_lite(yi, sei):
# Your code here
pass5 test cases · run your code against them in the editor