Skip to content
View niuniuhaoyu's full-sized avatar
🎯
Focusing
🎯
Focusing

Block or report niuniuhaoyu

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Content in all repositories owned by your account will be closed.
Maximum 250 characters. Please don’t include any personal information such as legal names or email addresses. Markdown is supported. This note will only be visible to you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
niuniuhaoyu/README.md

Hi, I'm Haoyu Niu 👋

English | 简体中文

Senior undergraduate in Applied Economics at the City University of Macau.

I'm interested in econometrics and causal inference, and I build open-source tools for empirical research — currently focused on modern difference-in-differences methods, heterogeneous treatment effects, and their diagnostics.

Research interests

  • Causal inference & program evaluation
  • Difference-in-differences and pre-trends diagnostics
  • Heterogeneous treatment effects (causal forests / GRF)
  • Applied microeconometrics

Projects

Open-source tools for empirical analysis. I write them in Stata (ado + Mata) and Python, verify them against independent implementations, and ship the tests. Each Stata package ships English and Chinese documentation.

Stata packages

  • contdid — difference-in-differences with a continuous treatment (Callaway, Goodman-Bacon & Sant'Anna 2024): B-spline dose-response ATT(d) and the average causal response ACRT(d), uniform confidence bands, staggered adoption, and conditional parallel trends (covariates()). Cross-validated against the authors' R implementation.

  • qdid — quantile difference-in-differences (Callaway & Li 2019): the quantile treatment effect on the treated QTT(τ) via copula stability, cluster-bootstrap intervals, a uniform confidence band, conditional QTT, and staggered adoption. Matched to R qte.

  • didc — difference-in-discontinuities (Picchetti, Pinto & Shinoki 2026): local polynomial estimation when a confounding policy is assigned at the same cutoff, with the paper's two validity tests and partial-identification bounds. The estimation kernel is checked against an independently coded weighted-least-squares fit.

  • cforest — causal forests / generalized random forests for Stata (Wager & Athey 2018; Athey, Tibshirani & Wager 2019): the conditional average treatment effect with out-of-sample prediction, best linear projection, and variable importance; cross-checked against R grf.

Other

  • detective_engine — a constraint-driven detective-fiction generation engine (Python): backwards generation under fairness/solvability constraints, with an ingenuity scorer (inevitability × uniqueness × surprise).

  • sop-pensieve — a living library of research & tooling SOPs ("pensieve"): case replication, DID/empirical-analysis standards, reference verification, pre-submission checklists, and AI-assisted coding verification. Every finished task leaves a reusable procedure behind.

Links


English | 简体中文

Popular repositories Loading

  1. contdid contdid Public

    Stata package for difference-in-differences with a continuous treatment (Callaway–Goodman-Bacon–Sant'Anna 2024): B-spline dose-response ATT(d) & ACRT(d), uniform confidence bands, staggered adoption.

    Stata 2

  2. sop-pensieve sop-pensieve Public

    A living library of research & tooling SOPs - reusable procedures distilled from finished work.

    2

  3. niuniuhaoyu niuniuhaoyu Public

    Economics + statistics + coding. Building Stata packages for frontier causal-inference methods (DiD/RD), with a focus on reproducible research.

    1

  4. niuniuhaoyu-didc niuniuhaoyu-didc Public

    Stata package for difference-in-discontinuities (Picchetti–Pinto–Shinoki 2026): local polynomial estimation when a confounder sits at the same cutoff, plus two validity tests and partial-identifica…

    Stata 1

  5. detective_engine detective_engine Public

    Constraint-driven detective-fiction generation engine (Python): backwards generation with fairness/solvability constraints and an ingenuity scorer.

    Python 1

  6. qdid qdid Public

    Quantile treatment effects in difference-in-differences for Stata (Callaway-Li 2019, copula stability): QTT with bootstrap CIs, uniform bands, covariates, and staggered adoption.

    Stata