TwoStep
twostepweakiv is a Stata module that implements two-step weak-instrument-robust confidence sets based on Andrews (2018) and refined projection method for subvector inference based on Chaudhuri and Zivot (2011) for linear instrumental-variable (IV) models. There is an accompanying Stata Journal article (Sun, 2018) that provides an overview on these methods and includes details for using twostepweakiv in Stata.
Install / Use
/learn @lsun20/TwoStepREADME
Package name: twostepweakiv
Title: Implementing valid two-step identification-robust confidence sets for linear instrumental-variables models
Author 1 name: Liyang Sun Author 1 from: Liyang Sun, Department of Economics, MIT, Cambridge, US Author 1 email: lsun20@mit.edu
Author 2 name:
Author 2 from:
Author 2 email:
Author 3 name:
Author 3 from:
Author 3 email:
Author 4 name:
Author 4 from:
Author 4 email:
Author 5 name:
Author 5 from:
Author 5 email:
Help keywords: twostepweakiv
File list: twostepweakiv.ado twostepweakiv.sthlp
Notes: To replicate the simulation results in Section 2, run the following in the same directory
- weakiv_simulation_generate.do (outputs simulated datasets to ./monte_carlo_p1_data/)
- weakiv_p1_rejection.do (outputs monte_carlo_p1_het_wald.dta)
- rejection_curves.do weakiv_simulation_generate.do generates random draws,weakiv_p1_rejection.do calculates test statistics, and rejection_curves.do plots the coverage curves using outputs from weakiv_p1_rejection.do.
To replicate the simulation results in Section 5, run the following in the same directory
- Twostep_simulation_generate.do (outputs simulated datasets to ./monte_carlo_data/)
- projection_2sls_power_strong.do (outputs monte_carlo_2sls_power_strong_het.xlsx)
- projection_2sls_power_weak.do (outputs monte_carlo_2sls_power_weak_het.xlsx)
- power_curves.do Twostep_simulation_generate.do generates random draws, projection_2sls_power_xx.do calculates power, and power_curves.do plots the power curves using outputs from projection_2sls_power_xx.do (need to (un)comment the appropriate filename and norm local)
Related Skills
node-connect
351.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
110.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
351.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
351.2kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
