全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
9394 9
2021-05-30
说明:
1.不同体现在回归系数不同,p值不同,甚至影响主要解释变量的显著性;
2.使用了sort命令,id没有重复。

请问大家这可能是什么原因造成的?

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2021-5-30 19:28:59
请给出具体的示例,
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2021-5-31 08:55:19
把你的命令贴上来啊,什么都没有大家怎么回答啊
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2021-5-31 17:16:26
感谢回复,初入论坛经验不足,请大家海涵~

1.以下为数据处理代码:
clear
use "E:\学术小天地\房子与幸福感\data\2017年家庭金融调查数据库\2017年家庭金融调查数据_数据集_13版\chfs2017_master_city_20191120.dta", clear
keep hhid province rural swgt_h swgt_p
sort hhid
save province_house, replace
use "E:\学术小天地\房子与幸福感\data\2017年家庭金融调查数据库\2017年家庭金融调查数据_数据集_13版\ind2017_20191202_所有.dta", clear
keep hhid a2001 a2005 a2012 a2024 a2003 a2025b
gen age = 2017 - a2005
gen age2 = age^2
drop a2005
rename a2012 edu
***初中及以下***
replace edu = 1 if edu == 1 | edu == 2 | edu == 3
***高中、中专、职高***
replace edu = 2 if edu == 4 | edu == 5
***大专***
replace edu = 3 if edu ==6
***本科、硕士、博士***
replace edu = 4 if edu == 7 | edu == 8 | edu == 9
rename a2024 marital
replace marital = 0 if marital == 1 | marital == 3 | marital == 4 | marital == 5 | marital == 6
replace marital = 1 if marital == 2 |  marital == 7
rename a2003 gender
replace gender = 0 if gender == 2
rename a2025b health
replace health = 7 if health == 1
replace health = 6 if health == 2
replace health = 2 if health == 4
replace health = 1 if health == 5
replace health = 5 if health == 7
replace health = 4 if health == 6
sort hhid
merge m:m hhid using province_house,update
drop _merge
sort hhid
save ind_house, replace
use "E:\学术小天地\房子与幸福感\data\2017年家庭金融调查数据库\2017年家庭金融调查数据_数据集_13版\hh2017_20191120_所有.dta", clear
keep hhid total_income h3514 c1001 c1004 c2004_1 c2004_2 c2004_3 c2004_4 c2004_5 c2004_6 c2008b_1 c2008b_2 c2008b_3 c2008b_4 c2008b_5 c2008b_6
rename total_income income
gen lnincome = log(income)
rename h3514 happiness
replace happiness = 7 if happiness == 1
replace happiness = 6 if happiness == 2
replace happiness = 2 if happiness == 4
replace happiness = 1 if happiness == 5
replace happiness = 5 if happiness == 7
replace happiness = 4 if happiness == 6
rename c1001 htype
gen property = 0
replace property = 1 if htype == 1
gen hsquare = c1004 if htype == 2 | htype == 3
replace hsquare = c2004_1 if c2008b_1 == 1
replace hsquare = c2004_2 if c2008b_2 == 1
replace hsquare = c2004_3 if c2008b_3 == 1
replace hsquare = c2004_4 if c2008b_4 == 1
replace hsquare = c2004_5 if c2008b_5 == 1
replace hsquare = c2004_6 if c2008b_6 == 1
drop c1004 c2004_1 c2004_2 c2004_3 c2004_4 c2004_5 c2004_6 c2008b_1 c2008b_2 c2008b_3 c2008b_4 c2008b_5 c2008b_6
sort hhid
merge m:m hhid using ind_house,update
drop _merge
save hh_house, replace
import excel "E:\学术小天地\房子与幸福感\data\2017房价数据-省-年度.xls", sheet("Sheet1") firstrow clear
keep A D
rename A provincestr
rename D hprice
gen lnhprice = log(hprice)
sort provincestr
save hprice, replace
use hh_house, clear
decode province, gen(provincestr)
sort provincestr
merge m:1 provincestr using hprice
drop _merge
drop provincestr
drop if a2001 !=1
drop a2001
egen miss = rowmiss(_all)
drop if miss != 0
drop miss
winsor2 income hsquare age, replace cuts (1 99)
sum happiness hprice income age edu marital gender health rural property hsquare
save full_data1, replace

2. 执行以上命令2次,得到相同的描述性统计,如下:
(1)第一次结果:
   Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
   happiness |     18323     3.84091    .8188524          1          5
      hprice |     18323    9934.169    7090.194       4165      34117
      income |     18323    91898.81    119020.5    193.085   788576.5
         age |     18323    52.64007    16.08309         20         85
         edu |     18323    1.734214     1.03079          1          4
-------------+--------------------------------------------------------
     marital |     18323    .7960487    .4029442          0          1
      gender |     18323    .5028653    .5000054          0          1
      health |     18323    3.454947    .9993328          1          5
       rural |     18323    .2262184    .4183936          0          1
    property |     18323    .6840583    .4649025          0          1
-------------+--------------------------------------------------------
     hsquare |     18323    84.17151     64.1467         10        400

(2)第二次结果:
   Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
   happiness |     18323     3.84091    .8188524          1          5
      hprice |     18323    9934.169    7090.194       4165      34117
      income |     18323    91898.81    119020.5    193.085   788576.5
         age |     18323    52.64007    16.08309         20         85
         edu |     18323    1.734214     1.03079          1          4
-------------+--------------------------------------------------------
     marital |     18323    .7960487    .4029442          0          1
      gender |     18323    .5028653    .5000054          0          1
      health |     18323    3.454947    .9993328          1          5
       rural |     18323    .2262184    .4183936          0          1
    property |     18323    .6840583    .4649025          0          1
-------------+--------------------------------------------------------
     hsquare |     18323    84.17151     64.1467         10        400

3. 执行oprobit回归命令2次,得到不同的结果:
(1)第一次结果:
Ordered probit regression                         Number of obs   =      18323
                                                  Wald chi2(13)   =     700.97
                                                  Prob > chi2     =     0.0000
Log pseudolikelihood = -1.744e+08                 Pseudo R2       =     0.0355

------------------------------------------------------------------------------
             |               Robust
   happiness |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
    lnhprice |  -.0438804   .0241215    -1.82   0.069    -.0911576    .0033968
    lnincome |   .0449901   .0086231     5.22   0.000     .0280891     .061891
         age |  -.0413227   .0048145    -8.58   0.000     -.050759   -.0318865
        age2 |   .0005369   .0000456    11.76   0.000     .0004475    .0006264
             |
         edu |
          2  |   .0098188   .0307178     0.32   0.749    -.0503869    .0700245
          3  |  -.0010152   .0414455    -0.02   0.980    -.0822468    .0802164
          4  |   .0133474   .0405819     0.33   0.742    -.0661917    .0928864
             |
   1.marital |   .2308472   .0334034     6.91   0.000     .1653778    .2963167
    1.gender |  -.0590439   .0240239    -2.46   0.014    -.1061299    -.011958
      health |   .2214292   .0141692    15.63   0.000     .1936581    .2492002
     1.rural |   .0914092   .0338109     2.70   0.007      .025141    .1576774
  1.property |   .0562409   .0269148     2.09   0.037     .0034889    .1089929
     hsquare |   .0008728   .0002046     4.27   0.000     .0004719    .0012737
-------------+----------------------------------------------------------------
       /cut1 |    -1.8893   .2498203                     -2.378938   -1.399661
       /cut2 |  -1.143309   .2464571                     -1.626356   -.6602623
       /cut3 |   .0497612   .2476107                     -.4355468    .5350692
       /cut4 |   1.471006   .2485265                      .9839029    1.958109
------------------------------------------------------------------------------
(2)第二次结果:
Ordered probit regression                         Number of obs   =      18323
                                                  Wald chi2(13)   =     735.30
                                                  Prob > chi2     =     0.0000
Log pseudolikelihood = -1.738e+08                 Pseudo R2       =     0.0362

------------------------------------------------------------------------------
             |               Robust
   happiness |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
    lnhprice |  -.0369084    .023801    -1.55   0.121    -.0835576    .0097408
    lnincome |   .0455094   .0085176     5.34   0.000     .0288151    .0622037
         age |  -.0418628   .0047311    -8.85   0.000    -.0511356     -.03259
        age2 |   .0005423   .0000448    12.11   0.000     .0004546    .0006301
             |
         edu |
          2  |   .0162418   .0303299     0.54   0.592    -.0432036    .0756873
          3  |  -.0023572   .0416904    -0.06   0.955    -.0840689    .0793544
          4  |   .0094391   .0403457     0.23   0.815    -.0696371    .0885153
             |
   1.marital |   .2280683   .0330819     6.89   0.000      .163229    .2929076
    1.gender |  -.0592456   .0240172    -2.47   0.014    -.1063184   -.0121727
      health |   .2247194    .014199    15.83   0.000     .1968898     .252549
     1.rural |   .0988372   .0337502     2.93   0.003     .0326879    .1649864
  1.property |   .0616099   .0268107     2.30   0.022     .0090618     .114158
     hsquare |   .0008722   .0002068     4.22   0.000     .0004668    .0012776
-------------+----------------------------------------------------------------
       /cut1 |  -1.817774   .2496122                     -2.307005   -1.328543
       /cut2 |  -1.075892   .2459997                     -1.558042    -.593741
       /cut3 |   .1208648   .2468216                     -.3628966    .6046261
       /cut4 |   1.545501   .2475751                      1.060263     2.03074
------------------------------------------------------------------------------

问题:两次回归结果存在差异,可能是什么原因导致的?感谢各位大佬赐教~
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2021-5-31 18:04:19
wdlbcj 发表于 2021-5-30 19:28
请给出具体的示例,
已经附后,望赐教!
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2021-5-31 18:05:03
917968079 发表于 2021-5-31 08:55
把你的命令贴上来啊,什么都没有大家怎么回答啊
感谢指正,代码已附后,望赐教!
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群