{
  "title": "Reference calculations for the observed-variable workshop",
  "origin": "Independent Python calculations from the exact downloadable CSV; not a QuickPLS app run.",
  "dataset": "observed-workshop.csv",
  "dataset_sha256": "e25bcf32f9a44664c764bdd1051cbab247aec3fe463cf5dd65d07af35e15c4f9",
  "seed": 20261105,
  "software": {
    "numpy": "1.26.4",
    "scipy": "1.15.2"
  },
  "ols": {
    "outcome": "y",
    "predictors": [
      "x",
      "z",
      "m"
    ],
    "n": 120,
    "degrees_of_freedom": 116,
    "r_squared": 0.5060934939231877,
    "residual_standard_error": 0.8326310420142644,
    "sse": 80.41983644658814,
    "coefficients": [
      {
        "term": "Intercept",
        "estimate": -0.060551364529927126,
        "standard_error": 0.07643441679596373,
        "t": -0.7922002556984861,
        "p_two_sided": 0.4298610215315146,
        "ci95_low": -0.21193935791612184,
        "ci95_high": 0.09083662885626759
      },
      {
        "term": "x",
        "estimate": 0.2916199350082534,
        "standard_error": 0.10916645464836972,
        "t": 2.671332837065882,
        "p_two_sided": 0.008641329147455922,
        "ci95_low": 0.0754020163392588,
        "ci95_high": 0.507837853677248
      },
      {
        "term": "z",
        "estimate": 0.001816725475061065,
        "standard_error": 0.07814071437764963,
        "t": 0.02324940960074839,
        "p_two_sided": 0.981491272502713,
        "ci95_low": -0.15295080526929383,
        "ci95_high": 0.15658425621941596
      },
      {
        "term": "m",
        "estimate": 0.6887755957308866,
        "standard_error": 0.10493457425975423,
        "t": 6.563857533036698,
        "p_two_sided": 1.538907081504865e-09,
        "ci95_low": 0.4809394493987318,
        "ci95_high": 0.8966117420630415
      }
    ],
    "largest_cooks_distances": [
      {
        "case_id": "o046",
        "fitted_y": -0.5035296594127149,
        "residual": 1.891218659412715,
        "leverage": 0.06570963741289443,
        "internally_studentized_residual": 2.3498936703852493,
        "cooks_distance": 0.09709204160386613
      },
      {
        "case_id": "o090",
        "fitted_y": -0.056415770868323376,
        "residual": -1.0517442291316768,
        "leverage": 0.098559063713075,
        "internally_studentized_residual": -1.3304204180255554,
        "cooks_distance": 0.04838125216489703
      },
      {
        "case_id": "o119",
        "fitted_y": -0.1569768962731921,
        "residual": -1.925454103726808,
        "leverage": 0.033456460630460705,
        "internally_studentized_residual": -2.352176256171764,
        "cooks_distance": 0.04787825404153098
      }
    ]
  },
  "ols_hc3": {
    "outcome": "y",
    "predictors": [
      "x",
      "z",
      "m"
    ],
    "n": 120,
    "degrees_of_freedom": 116,
    "r_squared": 0.5060934939231877,
    "residual_standard_error": 0.8326310420142644,
    "sse": 80.41983644658814,
    "coefficients": [
      {
        "term": "Intercept",
        "estimate": -0.060551364529927126,
        "standard_error": 0.07560051418517234,
        "t": -0.800938527767357,
        "p_two_sided": 0.42480469393607434,
        "ci95_low": -0.21028770872169922,
        "ci95_high": 0.08918497966184497
      },
      {
        "term": "x",
        "estimate": 0.2916199350082534,
        "standard_error": 0.11019015477619175,
        "t": 2.646515340690512,
        "p_two_sided": 0.009261823532821314,
        "ci95_low": 0.0733744492474098,
        "ci95_high": 0.509865420769097
      },
      {
        "term": "z",
        "estimate": 0.001816725475061065,
        "standard_error": 0.07210989546254401,
        "t": 0.025193844248529322,
        "p_two_sided": 0.9799436362998893,
        "ci95_low": -0.1410060085101255,
        "ci95_high": 0.14463945946024764
      },
      {
        "term": "m",
        "estimate": 0.6887755957308866,
        "standard_error": 0.10440534544524967,
        "t": 6.597129608580067,
        "p_two_sided": 1.3075659993123458e-09,
        "ci95_low": 0.48198765374997155,
        "ci95_high": 0.8955635377118017
      }
    ],
    "uncertainty": "HC3 covariance with Student-t reference and n-k residual degrees of freedom"
  },
  "mediator_ols": {
    "outcome": "m",
    "predictors": [
      "x",
      "z"
    ],
    "n": 120,
    "degrees_of_freedom": 117,
    "r_squared": 0.40841951264080567,
    "residual_standard_error": 0.7335691559028695,
    "sse": 62.960473659569686,
    "coefficients": [
      {
        "term": "Intercept",
        "estimate": -0.06392172140008893,
        "standard_error": 0.06708086621814052,
        "t": -0.952905426000637,
        "p_two_sided": 0.34260249726082903,
        "ci95_low": -0.19677186181714906,
        "ci95_high": 0.0689284190169712
      },
      {
        "term": "x",
        "estimate": 0.6270171252511079,
        "standard_error": 0.07674652675827946,
        "t": 8.169973961505233,
        "p_two_sided": 4.096504421266147e-13,
        "ci95_low": 0.4750246506279661,
        "ci95_high": 0.7790095998742497
      },
      {
        "term": "z",
        "estimate": 0.19750884237758326,
        "standard_error": 0.06637826586787927,
        "t": 2.9755047046680776,
        "p_two_sided": 0.0035544636661717717,
        "ci95_low": 0.06605016513700848,
        "ci95_high": 0.32896751961815807
      }
    ]
  },
  "total_ols": {
    "outcome": "y",
    "predictors": [
      "x",
      "z"
    ],
    "n": 120,
    "degrees_of_freedom": 117,
    "r_squared": 0.3226488440143279,
    "residual_standard_error": 0.9708971506425701,
    "sse": 110.2890294237258,
    "coefficients": [
      {
        "term": "Intercept",
        "estimate": -0.10457908626741717,
        "standard_error": 0.08878320653172558,
        "t": -1.1779151750961723,
        "p_two_sided": 0.24122077073754714,
        "ci95_low": -0.28040957444359604,
        "ci95_high": 0.07125140190876171
      },
      {
        "term": "x",
        "estimate": 0.7234940289865521,
        "standard_error": 0.10157595034052032,
        "t": 7.122690228948205,
        "p_two_sided": 9.274003443042476e-11,
        "ci95_low": 0.5223281820541046,
        "ci95_high": 0.9246598759189997
      },
      {
        "term": "z",
        "estimate": 0.13785599604579812,
        "standard_error": 0.08785329737098731,
        "t": 1.5691613197357772,
        "p_two_sided": 0.11931095097977454,
        "ci95_low": -0.036132855766034255,
        "ci95_high": 0.3118448478576305
      }
    ]
  },
  "mediation_arithmetic": {
    "a": 0.6270171252511079,
    "b": 0.6887755957308866,
    "direct": 0.2916199350082534,
    "indirect_product": 0.4318740939782998,
    "total": 0.7234940289865521,
    "meaning": "OLS decomposition for these variables and covariate. No causal identification or indirect-effect inference is established by this product."
  },
  "pca": {
    "variables": [
      "x",
      "z",
      "m",
      "y"
    ],
    "input": "sample correlation; mean centred and sample-standardized (ddof=1)",
    "rotation": "none",
    "eigenvalues": [
      2.3069869947773327,
      0.9492489065919153,
      0.4493942136535668,
      0.294369884977185
    ],
    "explained_variance_ratio": [
      0.5767467486943333,
      0.23731222664797885,
      0.11234855341339171,
      0.07359247124429627
    ],
    "component_weights": [
      [
        0.5285585359211428,
        0.23102002962542423,
        0.5893628407152102,
        0.56560327262213
      ],
      [
        -0.27418414333226887,
        0.9531139958449488,
        -0.004910222207663573,
        -0.12795568055969997
      ],
      [
        0.779207181385098,
        0.14605324092045968,
        -0.20531092488965375,
        -0.5738920137233801
      ],
      [
        -0.19566578169914794,
        -0.12989190757307828,
        0.7813288397486197,
        -0.5782458286889449
      ]
    ],
    "sign_rule": "largest absolute weight in each component is positive"
  },
  "binary_logit": {
    "outcome": "binary_outcome",
    "event": 1,
    "predictors": [
      "x",
      "z"
    ],
    "n": 120,
    "events": 57,
    "log_likelihood": -79.3497466424808,
    "coefficients": [
      {
        "term": "Intercept",
        "estimate": -0.12404533280790549,
        "standard_error": 0.1890751472195805,
        "odds_ratio": 0.8833397957018037,
        "wald_ci95_odds_ratio": [
          0.6097990442600447,
          1.2795841548379914
        ]
      },
      {
        "term": "x",
        "estimate": 0.5546451244342759,
        "standard_error": 0.22734496364356138,
        "odds_ratio": 1.7413229221557929,
        "wald_ci95_odds_ratio": [
          1.1152261211918912,
          2.7189154393052934
        ]
      },
      {
        "term": "z",
        "estimate": -0.22787482745242843,
        "standard_error": 0.18865418716115973,
        "odds_ratio": 0.7962239189744049,
        "wald_ci95_odds_ratio": [
          0.5501137302711355,
          1.1524390217173683
        ]
      }
    ],
    "example_probabilities": [
      {
        "x": 0,
        "z": 0,
        "probability": 0.469028370619991
      },
      {
        "x": 1,
        "z": 0,
        "probability": 0.6060168840350708
      }
    ]
  },
  "sources": [
    {
      "title": "SciPy least-squares regression documentation",
      "url": "https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.linregress.html"
    },
    {
      "title": "statsmodels regression reference",
      "url": "https://www.statsmodels.org/stable/regression.html"
    },
    {
      "title": "scikit-learn PCA reference",
      "url": "https://scikit-learn.org/stable/modules/generated/sklearn.decomposition.PCA.html"
    }
  ]
}
