{
  "alt": "Scatter plot of thousands of dots, one per district, with district income on a logarithmic horizontal axis and the male minus female math gap on the vertical axis. The dots form a wide cloud around zero that tilts upward to the right. A line of ten decile means with whiskers rises from below a horizontal rule at zero on the left to above it on the right.",
  "caption": "The cloud is wide at every income and tilts upward to the right; the markers rise from below the zero rule at low income to above it at high income. Dots are a random sample of {fact:n_sample} of the {fact:n_inc} districts; markers are test-weighted decile means with 95% intervals from a bootstrap over states.",
  "data": [],
  "id": "math_gap_by_income",
  "notes": [
    "The dots are a random sample of {fact:n_sample} districts (seed 12345) from the {fact:n_inc} in the income sample; the means, intervals, correlation and slope use all of them.",
    "Each gap is the mean score of boys minus the mean score of girls in the district, in grade levels, where one grade level is the learning of an average school year. A negative gap means girls scored higher. Scores pool third through eighth grade over 2009 to 2019, and the estimates are empirical-Bayes estimates, which pull the noisiest districts toward the average.",
    "District income is the mean of tract median household incomes in the district, weighted by households, from the American Community Survey for 2019 to 2023. The test scores pool 2009 to 2019, so income is measured after the scores, and districts are the boundaries of the 2021 to 2022 school year matched to SEDA by district code. It is not the median income of the district's households, and it is capped where the survey caps the highest incomes.",
    "Deciles, the tenths of districts ranked by income, hold equal numbers of districts. Each mean weights a district by its number of test scores, and the 95% intervals come from a bootstrap that resamples whole states. Marker positions are the test-weighted mean income of each decile.",
    "The income axis is logarithmic: equal distances are equal ratios of income."
  ],
  "source": "Stanford Education Data Archive 6.0, 2009-2019 and American Community Survey 2019-2023; test-weighted decile means, modeled estimates",
  "spec": {
    "overlays": [
      {
        "hi": "hi",
        "kind": "line",
        "label": "Decile means with 95% intervals",
        "lo": "lo",
        "rows": [
          {
            "hi": -0.153,
            "lo": -0.259,
            "n_units": 1213,
            "x": 45445,
            "y": -0.203
          },
          {
            "hi": -0.102,
            "lo": -0.19,
            "n_units": 1214,
            "x": 54649,
            "y": -0.145
          },
          {
            "hi": -0.093,
            "lo": -0.196,
            "n_units": 1213,
            "x": 60185,
            "y": -0.143
          },
          {
            "hi": -0.049,
            "lo": -0.154,
            "n_units": 1214,
            "x": 64934,
            "y": -0.102
          },
          {
            "hi": -0.013,
            "lo": -0.086,
            "n_units": 1214,
            "x": 69381,
            "y": -0.051
          },
          {
            "hi": -0.032,
            "lo": -0.111,
            "n_units": 1213,
            "x": 74203,
            "y": -0.071
          },
          {
            "hi": -0.017,
            "lo": -0.114,
            "n_units": 1214,
            "x": 80790,
            "y": -0.063
          },
          {
            "hi": 0.001,
            "lo": -0.101,
            "n_units": 1213,
            "x": 89476,
            "y": -0.061
          },
          {
            "hi": 0.063,
            "lo": -0.032,
            "n_units": 1214,
            "x": 104940,
            "y": 0.008
          },
          {
            "hi": 0.119,
            "lo": 0.038,
            "n_units": 1214,
            "x": 141955,
            "y": 0.08
          }
        ],
        "x": "x",
        "y": "y"
      },
      {
        "kind": "line",
        "label": "Equal scores",
        "markers": false,
        "rows": [
          {
            "x": 15000,
            "y": 0
          },
          {
            "x": 260000,
            "y": 0
          }
        ],
        "x": "x",
        "y": "y"
      }
    ],
    "payload": "math_gap_by_income.json",
    "x": "income",
    "xDomain": [
      15000,
      260000
    ],
    "xFormat": {
      "digits": 0,
      "prefix": "$",
      "thousands": true
    },
    "xLabel": "District median household income (dollars, log scale)",
    "xScale": "log",
    "y": "gap",
    "yDomain": [
      -1.3,
      1.3
    ],
    "yFormat": {
      "digits": 1,
      "signed": true
    },
    "yLabel": "Male minus female math gap (grade levels)"
  },
  "subtitle": "Male minus female math gap in grade levels against district median household income in dollars (log scale), one dot per district, with test-weighted decile means",
  "title": "Districts at one income level differ widely in their math gap, and the decile means rise with income, a correlation of {fact:mth_inc_r} with income rank",
  "type": "scatter",
  "width": "wide"
}
