R中的tobit模型,使用censReg(),具有任意截尾观测值

R中的tobit模型,使用censReg(),具有任意截尾观测值,r,R,使用censReg()函数估计R中的tobit模型。似乎审查后的观察值并不重要(当然,只要它们低于审查值)。在下面的代码中比较tobit1和tobit2是正确的。但是,当我改变观测值一点点时(从-2.8e5到-2.9e5),结果会完全改变。知道这是怎么回事吗 set.seed(8) n = 200 x = rnorm(n) a=3; b = 3 # generate latent y; censoring value k; and observed z y = rnorm(n, a+b*x) k

使用censReg()函数估计R中的tobit模型。似乎审查后的观察值并不重要(当然,只要它们低于审查值)。在下面的代码中比较tobit1和tobit2是正确的。但是,当我改变观测值一点点时(从-2.8e5到-2.9e5),结果会完全改变。知道这是怎么回事吗

set.seed(8)
n = 200
x = rnorm(n)
a=3; b = 3
# generate latent y; censoring value k; and observed z
y = rnorm(n, a+b*x)
k = 2
z = ifelse(y>k, y, 0)
table(z==0) # 82 T, 118 F

# tobit with "reasonable" observed values for censored obs:
tobit1 = censReg(z~x,left=k) 

# tobit with arbitrarily low observed values for censored obs:
z2 = ifelse(y>k, y, -2.8e5)
tobit2 = censReg(z2~x,left=k) 
# ... and even lower:
z3 = ifelse(y>k, y, -2.9e5)
tobit3 = censReg(z3~x,left=k) 

stargazer(tobit1,tobit2,tobit3,type='text')

=================================================
因变量:
-----------------------------
zz2z3
(1)      (2)       (3)    
-------------------------------------------------
x 2.988***2.988***8518.070
(0.109)  (0.109)            
对数西格玛-0.090-0.090 8.808
(0.065)  (0.065)            
常数2.937***2.937***-7792.855
(0.097)  (0.097)            
-------------------------------------------------
意见200
对数似然-177.353-177.353-1201.950
阿凯克中校。360.707  360.707  2,409.899 
贝叶斯克里特。370.602  370.602  2,419.794 
=================================================

注:*p好吧,这令人失望。我通过谷歌确定
censReg
在软件包“censReg”(这一事实表面上并不明显)中,安装了软件包及其依赖项,并加载了“censReg”和“stargazer”。现在我明白了:

> # tobit with "reasonable" observed values for censored obs:
> tobit1 = censReg(z~x,left=k) 
Warning message:
In censReg(z ~ x, left = k) :
  at least one value of the endogenous variable is smaller than the left limit
> 
> # tobit with arbitrarily low observed values for censored obs:
> z2 = ifelse(y>k, y, -2.8e5)
> tobit2 = censReg(z2~x,left=k) 
Warning message:
In censReg(z2 ~ x, left = k) :
  at least one value of the endogenous variable is smaller than the left limit
> # ... and even lower:
> z3 = ifelse(y>k, y, -2.9e5)
> tobit3 = censReg(z3~x,left=k) 
Warning message:
In censReg(z3 ~ x, left = k) :
  at least one value of the endogenous variable is smaller than the left limit

stargazer(tobit1,tobit2,tobit3,type='text')

=================================================
                         Dependent variable:     
                    -----------------------------
                        z        z2        z3    
                       (1)       (2)       (3)   
-------------------------------------------------
x                   2.988***  2.988***  2.988*** 
                     (0.109)   (0.109)   (0.109) 

logSigma             -0.090    -0.090    -0.090  
                     (0.065)   (0.065)   (0.065) 

Constant            2.937***  2.937***  2.937*** 
                     (0.097)   (0.097)   (0.097) 

-------------------------------------------------
Observations           200       200       200   
Log Likelihood      -177.353  -177.353  -177.353 
Akaike Inf. Crit.    360.707   360.707   360.707 
Bayesian Inf. Crit.  370.602   370.602   370.602 
=================================================
Note:                 *p<0.1; **p<0.05; ***p<0.01
> # tobit with "reasonable" observed values for censored obs:
> tobit1 = censReg(z~x,left=k) 
Warning message:
In censReg(z ~ x, left = k) :
  at least one value of the endogenous variable is smaller than the left limit
> 
> # tobit with arbitrarily low observed values for censored obs:
> z2 = ifelse(y>k, y, -2.8e5)
> tobit2 = censReg(z2~x,left=k) 
Warning message:
In censReg(z2 ~ x, left = k) :
  at least one value of the endogenous variable is smaller than the left limit
> # ... and even lower:
> z3 = ifelse(y>k, y, -2.9e5)
> tobit3 = censReg(z3~x,left=k) 
Warning message:
In censReg(z3 ~ x, left = k) :
  at least one value of the endogenous variable is smaller than the left limit

stargazer(tobit1,tobit2,tobit3,type='text')

=================================================
                         Dependent variable:     
                    -----------------------------
                        z        z2        z3    
                       (1)       (2)       (3)   
-------------------------------------------------
x                   2.988***  2.988***  2.988*** 
                     (0.109)   (0.109)   (0.109) 

logSigma             -0.090    -0.090    -0.090  
                     (0.065)   (0.065)   (0.065) 

Constant            2.937***  2.937***  2.937*** 
                     (0.097)   (0.097)   (0.097) 

-------------------------------------------------
Observations           200       200       200   
Log Likelihood      -177.353  -177.353  -177.353 
Akaike Inf. Crit.    360.707   360.707   360.707 
Bayesian Inf. Crit.  370.602   370.602   370.602 
=================================================
Note:                 *p<0.1; **p<0.05; ***p<0.01
 maintainer("censReg")
[1] "Arne Henningsen <arne.henningsen@gmail.com>"
 sessionInfo()

R version 3.6.1 (2019-07-05)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.3 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/libopenblasp-r0.2.20.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8       
 [4] LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C              
[10] LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] stargazer_5.2.2   censReg_0.5-30    maxLik_1.3-6      miscTools_0.6-22  vars_1.5-3       
 [6] lmtest_0.9-37     urca_1.3-0        strucchange_1.5-1 sandwich_2.5-1    zoo_1.8-6        
[11] MASS_7.3-51.4     MTS_1.0          

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.3          Formula_1.2-3       magrittr_1.5        lattice_0.20-38    
 [5] bibtex_0.4.2        stringr_1.4.0       timeSeries_3042.102 tools_3.6.1        
 [9] grid_3.6.1          glmmML_1.1.0        timeDate_3043.102   nlme_3.1-141       
[13] yaml_2.2.0          bdsmatrix_1.3-3     Rdpack_0.11-0       gbRd_0.4-11        
[17] plm_2.1-0           fGarch_3042.83.1    stringi_1.4.3       compiler_3.6.1     
[21] fBasics_3042.89     spatial_7.3-11      mvtnorm_1.0-11