簡體   English   中英

計算 R 中 Tobit 的虛擬(及其標准誤差)的邊際效應

[英]Calculate marginal effect of dummy (and its standard error) for Tobit in R

我有一個標准的 Tobit 模型,其中唯一的解釋變量是處理的虛擬變量(加上截距),我想估計這種處理對我的因變量的邊際影響以及這個 ME 的標准誤差。

我知道 R 中的 mfx 包能夠恢復我想要的 Probit 和 Logit 模型,但我找不到類似的 Tobit 包。 有誰知道可以執行此操作的軟件包或如何通過“手動”恢復 ME 及其標准錯誤? 謝謝!

編輯:AER 包有一個估計 Tobit 模型的函數,所以我正在尋找使用它計算 ME(和 ME 的標准誤差)的某種方法。 這是我使用 AER 包中的數據所做的一個示例。

library(AER)

data("CollegeDistance")

model <- tobit(CollegeDistance$education ~ CollegeDistance$gender, left = 0, data = CollegeDistance, x= TRUE)

使用此代碼,我可以恢復截距和虛擬變量(性別)、尺度參數以及“性別”和截距的平均值的 Tobit 系數。 但與 Probit/Logit 的 mfx 包不同,AER 包中的 Tobit 函數不返回性別對受教育年限的邊際效應或其標准誤差。

所以,我想知道是否 1) 是否有人知道如何從 AER 的 tobit 函數的輸出中恢復 ME 和 ME 的標准錯誤,或者是否 2) 有人知道像 probitmfx 對 Probit 那樣工作的函數? 再次感謝。

您可能想嘗試marginaleffects包。 (免責聲明:我是維護者。)

library(AER)
library(marginaleffects)
data("CollegeDistance")
model <- tobit(education ~ gender, left = 0, data = CollegeDistance, x= TRUE)
mfx <- marginaleffects(model)
summary(mfx)
## Average marginal effects 
##       type         Term  Effect Std. Error z value Pr(>|z|)   2.5 %  97.5 %
## 1 response genderfemale -0.0351    0.05222 -0.6722  0.50148 -0.1374 0.06725
## 
## Model type:  tobit 
## Prediction type:  response

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM