{
  "title": "Put a Wilson interval beside a small retention estimate",
  "synthetic": true,
  "inputs": {
    "n": 100,
    "x": 20
  },
  "outputs": [
    {
      "label": "Point estimate %",
      "actual": 20,
      "expected": 20,
      "passed": true
    },
    {
      "label": "Wilson lower %",
      "actual": 13.33659225590988,
      "expected": 13.336592255909878,
      "passed": true
    },
    {
      "label": "Wilson upper %",
      "actual": 28.88309619265024,
      "expected": 28.883096192650235,
      "passed": true
    }
  ],
  "constraints": [
    "v.x<=v.n"
  ],
  "formulas": [
    {
      "label": "Point estimate %",
      "javascript": "100*v.x/v.n"
    },
    {
      "label": "Wilson lower %",
      "javascript": "100*(v.x/v.n+1.96**2/(2*v.n)-1.96*Math.sqrt((v.x/v.n*(1-v.x/v.n)+1.96**2/(4*v.n))/v.n))/(1+1.96**2/v.n)"
    },
    {
      "label": "Wilson upper %",
      "javascript": "100*(v.x/v.n+1.96**2/(2*v.n)+1.96*Math.sqrt((v.x/v.n*(1-v.x/v.n)+1.96**2/(4*v.n))/v.n))/(1+1.96**2/v.n)"
    }
  ],
  "limits": "Use a pre-specified analysis plan for comparisons or repeated monitoring. Overlapping or non-overlapping intervals alone are not a complete test of the difference between two campaign treatments."
}
