楼主: 10628903
2474 4

[面板数据求助] 新手小白求教,论文用的STATA(是一个师姐帮助编辑的命令),现在导师提了新问题求教 [推广有奖]

  • 0关注
  • 0粉丝

高中生

42%

还不是VIP/贵宾

-

威望
0
论坛币
947 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
102 点
帖子
17
精华
0
在线时间
50 小时
注册时间
2009-6-15
最后登录
2022-3-15

楼主
10628903 发表于 2019-10-6 23:06:32 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
新人小白紧急求教。在写论文,数据啥的都是自己整理的,因为对STATA几乎一窍不通,于是之前一个师姐帮着写了一段命令,得出了部分结论。现在外方导师提出了新的问题,我就不知道咋整理。貌似是需要修改或添加之前师姐写的命令。我把之前的命令导出结果汇报出来,然后把外方导师的问题也发出来。请老师们不吝指导,多谢多谢。

. use "C:\Users\notti\Desktop\panel.dta", clear
. do "C:\Users\notti\Desktop\panel.do"
. cd "C:\Users\notti\Desktop"
C:\Users\notti\Desktop
. clear
. import excel "目标企业财务数据全.xls",firstrow
. drop in 1
(1 observation deleted)
. destring _all, replace
序号 already numeric; no replace
股票名称 contains nonnumeric characters; no replace
证券代码 has all characters numeric; replaced as long
会计期间 contains nonnumeric characters; no replace
资产总计 has all characters numeric; replaced as double
短期借款 has all characters numeric; replaced as double
(683 missing values generated)
长期借款 has all characters numeric; replaced as double
(2193 missing values generated)
负债合计 has all characters numeric; replaced as double
(1 missing value generated)
实收资本或股本 has all characters numeric; replaced as double
资本公积 has all characters numeric; replaced as double
(5 missing values generated)
盈余公积 has all characters numeric; replaced as double
(21 missing values generated)
未分配利润 has all characters numeric; replaced as double
少数股东权益 has all characters numeric; replaced as double
(2753 missing values generated)
所有者权益合计 has all characters numeric; replaced as double
净利润 has all characters numeric; replaced as double
ROE has all characters numeric; replaced as double
Asset has all characters numeric; replaced as double
Equityfinancingrate has all characters numeric; replaced as double
Debtfinancingrate has all characters numeric; replaced as double
Endogenousfinancingrate has all characters numeric; replaced as double
Assetgrowthrate has all characters numeric; replaced as double
(66 missing values generated)
DUM has all characters numeric; replaced as byte
. duplicates drop 股票名称 会计期间,force
Duplicates in terms of 股票名称 会计期间
(3,597 observations deleted)
.
.
. rename 会计期间 date
.
. gen year=substr(date,1,4)
. gen month=substr(date,6,2)
.
. gen quarter=.
(3,605 missing values generated)
. destring month,replace
month has all characters numeric; replaced as byte
. replace quarter=04 if month==12
(772 real changes made)
. replace quarter=03 if month==9
(773 real changes made)
. replace quarter=02 if month==6
(773 real changes made)
. replace quarter=01 if month==3
(772 real changes made)
. drop if quarter==.
(515 observations deleted)
. destring year quarter,replace
year has all characters numeric; replaced as int
quarter already numeric; no replace
.
. gen date2=yq(year,quarter)
. format date2 %tq
.
. rename 股票名称 id
. *设定面板结构
. xtset 证券代码 date2
       panel variable:  证券代码 (unbalanced)
        time variable:  date2, 2015q4 to 2018q3
                delta:  1 quarter
.
. gen lasset=ln(Asset)
. gen l1ROE=l.ROE
(258 missing values generated)
. *xtline ROE
.
.
. findit logout
. *描述性统计表
. logout, save(summary)  word replace:tabstat ROE lasset Equityfinancingrate Debtfinancingrate /*
> */Endogenousfinancingrate Assetgrowthrate DUM,stat(mean p50 sd max min) c(s)
    variable |      mean       p50        sd       max       min
-------------+--------------------------------------------------
         ROE | -.0062939  .0192537  1.230277  2.465212 -46.40431
      lasset |  22.58278  22.47339  1.191642  26.28774  19.66508
Equityfina~e |  .6373304  .6695688  .3335581         1  -6.62198
Debtfinanc~e |  .1094083  .0783635  .1196442  .8571863         0
Endogenous~e |  .0957957  .1089636  .6439946   .755443 -17.78893
Assetgrowt~e |  -.068594 -.1687937  1.371248  34.52889 -.9940772
         DUM |  .3106796         0  .4628468         1         0
----------------------------------------------------------------
summary.rtf
dir
.
. *面板回归 xtreg
. xtreg ROE lasset Equityfinancingrate Debtfinancingrate /*
> */Endogenousfinancingrate Assetgrowthrate DUM,fe
note: DUM omitted because of collinearity
Fixed-effects (within) regression               Number of obs     =      3,024
Group variable: 证券代码                        Number of groups  =        258
R-sq:                                           Obs per group:
     within  = 0.0267                                         min =          8
     between = 0.0016                                         avg =       11.7
     overall = 0.0017                                         max =         12
                                                F(5,2761)         =      15.15
corr(u_i, Xb)  = -0.7342                        Prob > F          =     0.0000
-----------------------------------------------------------------------------------------
                    ROE |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
------------------------+----------------------------------------------------------------
                 lasset |  -.0867875   .0707009    -1.23   0.220    -.2254194    .0518444
    Equityfinancingrate |   2.830594   .3400175     8.32   0.000      2.16388    3.497309
      Debtfinancingrate |   1.708028    .482442     3.54   0.000     .7620441    2.654011
Endogenousfinancingrate |  -1.119337   .1350002    -8.29   0.000    -1.384049   -.8546255
        Assetgrowthrate |   .0156649   .0172084     0.91   0.363    -.0180777    .0494076
                    DUM |          0  (omitted)
                  _cons |   .0690197   1.541818     0.04   0.964    -2.954213    3.092252
------------------------+----------------------------------------------------------------
                sigma_u |  .68272882
                sigma_e |  1.2094248
                    rho |  .24165912   (fraction of variance due to u_i)
-----------------------------------------------------------------------------------------
F test that all u_i=0: F(257, 2761) = 1.59                   Prob > F = 0.0000
. est store fe
.
.
. findit outreg2
. logout, save(result)  word replace:esttab re ,se r2 mtitle star(* 0.1 ** 0.05 *** 0.01)
estimation result re not found
r(111);
end of do-file
r(111);
.
外方导师提出的问题如下:
You need to re-estimate the model again and take into account the fixedeffects and random effects. I can see from the table that the dummy variablehas been dropped due to collinearity. You need to check your series for Unitroots using panel unit roots tests such as ADF, Fisher etc.


请教老师们,我该如何在STATA用通过输入新命令,回答外放老师提出的问题呢,多谢多谢。
二维码

扫码加我 拉你入群

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

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


沙发
10628903 发表于 2019-10-7 17:45:26
顶上去,期待好心人讲解~~

藤椅
10628903 发表于 2019-10-8 20:36:16
顶顶,期待好心人解答

板凳
917968079 发表于 2019-10-9 08:28:59 来自手机
3个问题
1,让你考虑固定和随机效应,应该是做一下检验。
2,存在多重共线
3,检验是否为平稳序列,进行面板单位根检验

报纸
10628903 发表于 2019-10-11 11:45:11
917968079 发表于 2019-10-9 08:28
3个问题
1,让你考虑固定和随机效应,应该是做一下检验。
2,存在多重共线
收到,谢谢。这两天自己把第一个和第二个问题弄好了,正在弄第三个

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2026-1-1 19:32