經濟學如何看待中介效應?
考據
第一個推文的意思是說,如果引入中介變量,那你不得不考慮關鍵自變量和中介變量的內生性問題。如果你只考慮了關鍵自變量的內生性問題,而不考慮中介變量的內生性問題,那你就不認為中介變量是個關鍵影響變量!如果這樣,你還需要研究它嗎?而誰都知道,找一個工具變量就夠頭疼的了,還要找第二個?第一個推文的意思是這些。
第二個推文意思是心理學的舶來品,統計學、管理學和心理學都沒有像經濟學這樣聚焦因果關係識別,即使發在管理學、統計學頂級外刊的作品,在經濟學看來在識別方面存在不少問題,這是學科範式的問題。
計量經濟學非常講究殘差的clear,就是主方程儘量沒有遺漏變量,否則就不clear了。試想,如果中介變量不在中介模型的第一個方程,那是否意味著存在遺漏變量?!這不是內生性的一個緣由嗎?可能花了很大的力氣去消除內生性問題,為了用中介模型,又有意製造了個新的內生性問題。
以下是被經濟學大量引用的心理學文章:
最近,sata倒是出了1個處理內生性的中介效應模型命令,本公眾號介紹過:
中介效應、工具變量回歸中的因果中介分析| stata資料\新R語言資料
中介效應最新進展: 中介效應中的工具變量法使用方法及其代碼!
Abstract. In this article, we describe the use of ivmediate, a new command to estimate causal mediation eects in instrumental variables (IV) settings using the framework developed by Pinto et al. (2019). ivmediate allows to estimate a treatment eect and the share of this eect that can be attributed to a mediator variable. While both treatment and mediator can be potentially endogenous, a single instrument suffces to identify both the causal treatment and mediation effects.
Keywords: st0001, ivmediate, causal mediation analysis, treatment effects, instrumental variables
摘要:在本文中,我們描述了ivmediation的使用,這是一個新的命令,使用Pinto等人(2019)開發的框架來估計工具變量(IV)設置中的因果中介效應。ivmediation允許估計一個處理方面以及可歸因於中介變量的該方面的份額。而處理和中介都可能是內生性的,雖然處理變量 和 中介變量 可能 內生的。單個 工具變量足以識別處理和中介變量的因果效應。
處理內生性中介效應命令:ivmediate
Causal mediation analysis for linear instrumental variables models
線性工具變量模型的因果中介分析
//Syntaxcd D:\ivmediate_stata //ivmediate depvar [indepvars] [if] [in], mediator(varname) treatment(varname) instrument(varname) [options]use auto,clear //IV mediation analysis ivmediate price, med(trunk) treat(foreign) inst(turn)
//IV mediation analysis with display of intermediate results ivmediate price, med(trunk) treat(foreign) inst(turn) full
//IV mediation analysis with controls and clustered standard errors ivmediate price mpg weight, med(trunk) treat(foreign) inst(turn) vce(cluster rep78)分解中介效應:sgmediation
The purpose of the Sobel-Goodman tests are to test whether a mediator carries the influence of an IV to a DV.
A variable may be considered a mediator to the extent to which it carries the influence of a given independent variable (IV) to a given dependent variable (DV). Generally speaking, mediation can be said to occur when (1) the IV significantly affects the mediator, (2) the IV significantly affects the DV in the absence of the mediator, (3) the mediator has a significant unique effect on the DV, and (4) the effect of the IV on the DV shrinks upon the addition of the mediator to the model.
use https://stats.idre.ucla.edu/stat/data/hsbdemo, clearcd D:\中介效應statause hsbdemo,clearsgmediation science, mv(read) iv(math)sgmediation science, mv(read) iv(math) cv(write) * bootstrap with case resampling bootstrap r(ind_eff) r(dir_eff), reps(1000): sgmediation science, mv(read) iv(math) estat bootstrap, percentile bc
* bootstrap with residual resampling * need to install resboot_mediation findit resboot_mediaton ssc install resboot_mediaton resboot_mediation, dv(science) mv(read) iv(math) reps(1000)resboot_mediation
resboot_mediation performs a residual bootstrap on a mediation model with continuous mediation and response variables. The predictor variable may be binary or continuous. The indirect effect is computed as the product of coefficients.
use https://stats.idre.ucla.edu/stat/data/hsbdemo, clearresboot_mediation, dv(science) iv(math) mv(read)resboot_mediation, dv(science) iv(math) mv(read) cv(write socst)resboot_mediation, dv(science) iv(math) mv(read) ranres這三個帶因果識別的中介效應模型可自行用ssc install ...命令安裝,點擊文末閱讀原文,也有下載的,手動安裝在stata的ado文件夾。
其實,做機制分析,在經濟學界,比較規範的2個:做交互項模型,這在管理學被叫做調節效應,a對b的影響過程中受到c的調節;做分組回歸,異質性分析或許也可能發現某種機制。
更多因果識別檢驗、交互項問題,如果需要加速理解和掌握,可參見:
即將開班 | Python數據挖掘與Stata應用能力提升與實證前沿寒假工作坊
George E. P. Box:
Essentially, all models are wrong, but some are useful.
計量老師Prof Zhang:中介效應是錯的。不過計量學者有責任,為啥沒實證的看一看理論論文呢?這些都是90-2010年之間都討論完善的東西。
著名青年學者Mr Zhang:top 經濟學雜誌上,有中介效應麼,我是沒見過啊!
青年才俊Mr Zou:對於一種分析工具的功與過,不能一概而論,要看它的問題和研究目的適用性,如果找不到其他更好的方法,總比沒有方法要好。在檢驗變量之間的影響機制方面,中介效應模型還是能發揮一定的積極作用。
海龜教授Mr He:中介效應模型的問題其實就是沒有考慮內生性,top上做機制檢驗一般都是分組回歸,看交叉項,或者再做一個工具變量回歸。本來用個IV解決了內生性,來個中介效應模型又把內生性問題放大了。中介效應模型的結果顯著本質上就說明了你沒把遺漏變量的內生性問題處理乾淨,邏輯上屬於作者自己打臉的行為。
2019的R包例子
# Examples with JOBS II Field Experiment
# ** For illustration purposes a small number of simulations are used **
require(mediation)
require(parallel)
require(MASS)data(jobs)
a <- lm(comply ~ treat + sex + age + marital + nonwhite + educ + income,
data = jobs)
b <- glm(job_dich ~ comply + treat + sex + age + marital + nonwhite + educ + income,
data = jobs, family = binomial)
c <- lm(depress2 ~ job_dich * (comply + treat) + sex + age + marital + nonwhite + educ + income,
data = jobs)out <- ivmediate(a, b, c, sims = 50, boot = FALSE,
enc = "treat", treat = "comply", mediator = "job_dich")summary(out)
plot(out)# Using non-parametric bootstrap
out.boot <- ivmediate(a, b, c, sims = 50, boot = TRUE,
enc = "treat", treat = "comply", mediator = "job_dich")summary(out.boot)
plot(out.boot)
# }stata例子:
cd D:\ivmediate_stata
// open Becker and Woessmann (2009) replication data
use "ipehd_qje2009_master.dta"// define the vector of control variables
global controls "f_jew f_fem f_young f_pruss hhsize pop gpop f_miss"// run iv-mediation analysis
ivmediate inctax $controls, mediator(f_rw) treatment(f_prot) instrument(kmwitt)自變量和中介變量是內生的情況咋辦?放在因果中介的框架
出口學習效應研究,編譯自Detecting Learning by Exporting|附「新冠疫情對商業經濟模式的改變」視頻
在印度的450年葡萄牙殖民主義:傳教士,教育,和性別不平等的根源|附地理斷點回歸設計GRD(空間斷點回歸設計SRD)經典匯總
新晉克拉克獎得主Dell的地理斷點論文技術分析I:ArcGIS-Python地理數據處理,biprobit模型逆米爾茲比提取等
新晉克拉克獎得主Dell地理斷點論文技術分析II:ArcGIS-3D與R語言參數畫黑白和彩圖|附技術分析III部分stata資料
新晉克拉克獎得主Dell地理斷點論文技術分析III:ArcGIS地理數據導入stata形成計算數據等
氣泡圖、等高線、標籤、主題顏色、貝葉斯估計等的stata菜單操作、代碼設置一網打了
高級宏觀經濟理論|Acemoglu合集1993至2012年|內生轉化模型的stata操作要點
動態空間面板|空間協整數據模型理論、方法與推論|附Stata與Matlab操作要點、主程序和子程序m文件
機器學習與因果推斷課程閱讀大綱
衛星夜光數據校準與年度外推(附1992-2015年中國地級城市衛星夜光數據、夜光數據與中國工業企業資料庫、海關數據匹配代碼片段)
弱工具變量穩健推斷、PSM-DID合理使用等的Stata操作要點(附字幕版Impact of COVID-19crisis)
CES函數泰勒展開、歐拉方程與貝爾曼方程,讓經濟學走向邏輯理性的三個常用工具
區域經濟研究方法新動向:空間計量經濟學與因果識別DID的結合-空間倍差法SDID
QJE:一般均衡框架下的資源錯配與生產率
科普:細菌與病毒的區別,為什麼RNA病毒疫苗較難開發?
在線課堂測試錄播片段:Stata軟體安裝、日誌文件命令與自動篩選顯著變量程序分享
因果推斷的聖杯還是佔星術?充滿爭議的工具變量法之應用|開學第23講再論工具變量法的尋找、檢驗與前沿
EpiModel:在R軟體平臺構建、模擬和分析傳染病傳播的種群動態的數學模型工具
擴展工具變量多重高維固定效應面板回歸程序包在線或離線安裝|開學第15講Stata包離線install代碼
放鬆工具變量排他性假設的Stata操作原理與應用Stata包的離線安裝代碼|開學第13講IV前沿與擴展IV多重固定效應包安裝
雙重差分原理與三重差分簡要|開學第六講
結構分析:摘自The Margins of Global Sourcing Theory and Evidence
為何要在Fuzzy_RDD使用工具變量法?即在模糊斷點回歸,如何應付組間模糊的線?
入世與中國製造業企業績效:AER文章片段賞析、怎樣的經濟機器視頻
NBER:人口行動限制與新型冠狀病毒在中國的傳播 | 唧唧堂論文解析
唧唧堂:JIBS 國際商務研究 2020年2月刊論文摘要
中國博導要求掌握的RDD方法實證運用範文(配程序code), 不然就不要用RDD做實證研究!
乾貨: UN和WTO推薦的最全且權威的實證研究方法及在Stata實現!必收藏!
AER, AEJ上用準自然實驗識別的實證文章有哪些?含程序和code, 不看至少需要收藏一下!
【提供下載的命令數目已增加至 2908!】如何在幾秒鐘內完成 Stata 外部命令的安裝?
[學科前沿] HCW政策分析面板數據模型,亦或謂「回歸控制法」(RCM):附R代碼的經典文獻複製
基於ArcGlobe的全球行動電話,中國、美國、「一帶一路」沿線夜間燈光可視化分布
根據經緯度Stata制空間權重矩陣代碼數據:附空間計量經濟學軟體代碼與參考文獻