state命令

更新时间:2023-09-21 05:16:01 阅读量: 自然科学 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

一、回归

reg rlag audit_opinion du net_profit lev size total_assets_growth_rate eps net_asset_per_share jian_ren ind liquidity state

二、Person相关系数

pwcorr audit_opinion du net_profit lev size total_assets_growth_rate eps jian_ren ind liquidity state,sig

order stkcd accper auditing_date corporate_reporting_date first_booking_date rlag arlag rrlag urlag delay_pre audit_opinio

> n du net_profit loss size lev total_assets_growth_rate eps jian_ren ind liquidity state finance utilities proper

> ties conglomerates industrals commerce y2001 y2002 y2003 y2004 y2005 y2006 y2007 y2008 y2009 y2010

四、

reg rlag audit_opinion du loss size lev total_assets_growth_rate eps jian_ren ind liquidity shanghai shenzhen finance utilities properties conglomerates industrals commerce y2001 y2002 y2003 y2004 y2005 y2006 y2007 y2008 y2009 y2010

五、

order stkcd accper auditing_date corporate_reporting_date first_booking_date rlag arlag rrlag urlag delay_pre ch de pre a

> udit_opinion du loss size lev total_assets_growth_rate eps jian_ren ind liquidity shanghai shenzhen finance utilitie

> s properties conglomerates industrails1 industrails2 industrails3 industrails4 industrails5 industrails6 industrails7 industra

> ils8 industrails9 industrails10 industrails11 industrails12 industrails13 industrails14 commerce y2001 y2002 y2003 y2004 y2005

> y2006 y2007 y2008 y2009 y2010 industrals hangye hangye industrials

generate rr =finance + utilities+ properties + conglomerates + industrails1+ industrails2 + industrails3+ industrails4+ in

> dustrails5 + industrails6+ industrails7 + industrails8+ industrails9+ industrails10+ industrails11+ industrails12+ industrai > ls13+ industrails14 + commerce 七

sort audit_opinion结果是:

note: shenzhen omitted because of collinearity note: industrails12 omitted because of collinearity note: y2001 omitted because of collinearity

Linear regression Number of obs = 11783 F( 38, 11744) = 49.80 Prob > F = 0.0000 R-squared = 0.1272 Root MSE = 22.037

------------------------------------------------------------------------------ | Robust

rlag | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+----------------------------------------------------------------

audit_opin~n | 11.57641 .7647232 15.14 0.000 10.07743 13.07539 du | 5.896507 .4663501 12.64 0.000 4.982383 6.81063 loss | 7.63609 .7845307 9.73 0.000 6.098279 9.1739 size | 1.490203 .1928693 7.73 0.000 1.112147 1.868259 lev | .0164396 .0129624 1.27 0.205 -.0089689 .0418481 total_asse~e | -1.791161 .8010699 -2.24 0.025 -3.361391 -.2209309 eps | -3.815044 .7721173 -4.94 0.000 -5.328522 -2.301566 jian_ren | .3300953 .6455487 0.51 0.609 -.9352874 1.595478 ind | -2.423466 3.278779 -0.74 0.460 -8.850418 4.003485 liquidity | 5.693323 1.287414 4.42 0.000 3.169777 8.216868 shanghai | -.9541333 .430099 -2.22 0.027 -1.797199 -.1110678 shenzhen | (omitted)

finance | -11.76666 3.155108 -3.73 0.000 -17.9512 -5.582129 utilities | -10.81123 2.580241 -4.19 0.000 -15.86893 -5.75353 properties | -11.98033 2.608654 -4.59 0.000 -17.09373 -6.866937 conglomera~s | -7.103316 2.533246 -2.80 0.005 -12.0689 -2.137733 industrails1 | -8.477684 3.269423 -2.59 0.010 -14.88629 -2.069073 industrails2 | -8.513626 2.662219 -3.20 0.001 -13.73202 -3.295234 industrails3 | -9.724354 2.718352 -3.58 0.000 -15.05278 -4.395933 industrails4 | -16.82878 3.052956 -5.51 0.000 -22.81308 -10.84448 industrails5 | -12.74777 2.562424 -4.97 0.000 -17.77054 -7.724991 industrails6 | -10.44887 2.718395 -3.84 0.000 -15.77738 -5.120365 industrails7 | -14.05677 2.590017 -5.43 0.000 -19.13363 -8.979903 industrails8 | -10.41434 2.539308 -4.10 0.000 -15.39181 -5.436878 industrails9 | -12.51691 3.126312 -4.00 0.000 -18.645 -6.388815 industrai~10 | -10.48752 2.676442 -3.92 0.000 -15.7338 -5.241255 industrai~11 | -6.710359 2.714764 -2.47 0.013 -12.03175 -1.388971 industrai~12 | (omitted)

industrai~13 | -11.16011 3.62859 -3.08 0.002 -18.27275 -4.047467

industrai~14 | -10.02621 4.489388 -2.23 0.026 -18.82615 -1.226262 commerce | -6.835542 2.583339 -2.65 0.008 -11.89931 -1.771769 y2001 | (omitted)

y2002 | 2.51377 1.091078 2.30 0.021 .3750757 4.652464 y2003 | 4.46089 1.251938 3.56 0.000 2.006884 6.914897 y2004 | 4.040469 1.290264 3.13 0.002 1.511337 6.569602 y2005 | 5.895098 1.292352 4.56 0.000 3.361873 8.428323 y2006 | 7.705506 1.335294 5.77 0.000 5.088108 10.3229 y2007 | 6.811367 1.383911 4.92 0.000 4.098672 9.524061 y2008 | 6.135209 1.369071 4.48 0.000 3.451604 8.818815 y2009 | 3.03054 1.467612 2.06 0.039 .1537778 5.907302 y2010 | 4.615505 1.493128 3.09 0.002 1.688726 7.542284 _cons | 56.99181 4.706639 12.11 0.000 47.76601 66.2176

reg rlag audit_opinion du loss size lev total_assets_growth_rate eps jian_ren ind liquidity shanghai shenzhen

> finance utilities properties conglomerates industrails1 industrails2 industrails3 industrails4 industrails5 industrails6 indu

> strails7 industrails8 industrails9 industrails10 industrails11 industrails12 industrails13 industrails14 commerce y2001 y2002 y2

> 003 y2004 y2005 y2006 y2007 y2008 y2009 y2010

note: shenzhen omitted because of collinearity note: industrails12 omitted because of collinearity note: y2001 omitted because of collinearity

Source | SS df MS Number of obs = 11783 -------------+------------------------------ F( 38, 11744) = 45.03

Model | 830980.643 38 21867.9116 Prob > F = 0.0000 Residual | 5703197.53 11744 485.626492 R-squared = 0.1272 -------------+------------------------------ Adj R-squared = 0.1244

Total | 6534178.17 11782 554.589897 Root MSE = 22.037

------------------------------------------------------------------------------

rlag | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+----------------------------------------------------------------

audit_opin~n | 11.57641 .7815941 14.81 0.000 10.04436 13.10846 du | 5.896507 .4619195 12.77 0.000 4.991068 6.801946 loss | 7.63609 .7495539 10.19 0.000 6.16684 9.10534 size | 1.490203 .1871161 7.96 0.000 1.123425 1.856982 lev | .0164396 .0244699 0.67 0.502 -.0315254 .0644046 total_asse~e | -1.791161 .49559 -3.61 0.000 -2.762599 -.8197223 eps | -3.815044 .4336712 -8.80 0.000 -4.665112 -2.964977

jian_ren | .3300953 .6300117 0.52 0.600 -.9048323 1.565023 ind | -2.423466 3.337178 -0.73 0.468 -8.96489 4.117957 liquidity | 5.693323 1.26703 4.49 0.000 3.209733 8.176912 shanghai | -.9541333 .4259022 -2.24 0.025 -1.788972 -.1192944 shenzhen | (omitted)

finance | -11.76666 3.655417 -3.22 0.001 -18.93189 -4.60144 utilities | -10.81123 3.272019 -3.30 0.001 -17.22493 -4.397529 properties | -11.98033 3.275595 -3.66 0.000 -18.40104 -5.559621 conglomera~s | -7.103316 3.236891 -2.19 0.028 -13.44816 -.7584723 industrails1 | -8.477684 3.836692 -2.21 0.027 -15.99824 -.9571309 industrails2 | -8.513626 3.336386 -2.55 0.011 -15.0535 -1.973755 industrails3 | -9.724354 3.370693 -2.88 0.004 -16.33147 -3.117237 industrails4 | -16.82878 3.594037 -4.68 0.000 -23.87369 -9.78387 industrails5 | -12.74777 3.254566 -3.92 0.000 -19.12726 -6.368277 industrails6 | -10.44887 3.385778 -3.09 0.002 -17.08556 -3.812185 industrails7 | -14.05677 3.275747 -4.29 0.000 -20.47777 -7.635758 industrails8 | -10.41434 3.239929 -3.21 0.001 -16.76514 -4.063544 industrails9 | -12.51691 3.721996 -3.36 0.001 -19.81264 -5.221177 industrai~10 | -10.48752 3.352039 -3.13 0.002 -17.05808 -3.916973 industrai~11 | -6.710359 3.391467 -1.98 0.048 -13.3582 -.0625195 industrai~12 | (omitted)

industrai~13 | -11.16011 4.187375 -2.67 0.008 -19.36806 -2.952156 industrai~14 | -10.02621 4.864098 -2.06 0.039 -19.56065 -.491768 commerce | -6.835542 3.270861 -2.09 0.037 -13.24697 -.4241106 y2001 | (omitted)

y2002 | 2.51377 1.142483 2.20 0.028 .2743136 4.753226 y2003 | 4.46089 1.30815 3.41 0.001 1.8967 7.025081 y2004 | 4.040469 1.330165 3.04 0.002 1.433125 6.647814 y2005 | 5.895098 1.345963 4.38 0.000 3.256787 8.53341 y2006 | 7.705506 1.35983 5.67 0.000 5.040014 10.371 y2007 | 6.811367 1.394822 4.88 0.000 4.077284 9.54545 y2008 | 6.135209 1.41248 4.34 0.000 3.366514 8.903904 y2009 | 3.03054 1.472646 2.06 0.040 .1439089 5.917171 y2010 | 4.615505 1.515462 3.05 0.002 1.644949 7.586062 _cons | 56.99181 5.074188 11.23 0.000 47.04556 66.93806

九|stata 生成虚拟变量

2011-03-31 07:50 P.M.

生成虚拟变量

在很多场合,需要对分别变量(categorical variables)生成虚拟变量。Stata提供的xi命令能很方便地实现这一点。这是Stata最引人入胜的功能之一。本文仅介绍xi命令最基

本的用法:

xi [, prefix(string)] i.varname

varname是某一分类变量,设其共有m个可能的取值;string是prefix()指定的前缀。上述指令生成了K-1个虚拟变量:stringvarname_2, stringvarname_3, …, stringvarname_K。其中stringvarname表示字符串string和varname的联合。如果不使用[, prefix(string)]选项,则默认的前缀是_I。

例:数据集中year的取值范围是2001,2002,2003,2004,2005,则指令 xi i.year生成4个虚拟变量 _Iyear_2,_Iyear_3,_Iyear_4,_Iyear_5,分别对应year取值为2002,2003,2004,2005的情形。

-----------------------------------------------------------------------------------------------------------------------

tab x1,gen(x1) 产生x1的虚拟变量。

gen fsize1=fize==1 产生虚拟变量,如果family size为1,则令fsize1=1,否则为零。下同。

gen fsize2=fsize==2 gen fsize3=fsize==3 gen fsize4=fsize==4 gen fsize5=fsize>=5

十、

reg rlag audit_opinion du loss size income lev total_assets_growth_rate eps jian_ren ind liquidity state shanghai shenzhen fi

> nance utilities properties conglomerates industrails1 industrails2 industrails3 industrails4 industrails5 industrails6 indust

> rails7 industrails8 industrails9 industrails10 industrails11 industrails12 industrails13 industrails14 commerce y2001 y2002 y200

> 3 y2004 y2005 y2006 y2007 y2008 y2009 y2010 ,r

note: shenzhen omitted because of collinearity note: industrails12 omitted because of collinearity note: y2001 omitted because of collinearity

Linear regression Number of obs = 11783 F( 40, 11742) = 49.23 Prob > F = 0.0000 R-squared = 0.1309 Root MSE = 21.992

------------------------------------------------------------------------------ | Robust

rlag | Coef. Std. Err. t P>|t| [95% Conf. Interval]

-------------+----------------------------------------------------------------

audit_opin~n | 10.80226 .7700529 14.03 0.000 9.292833 12.3117 du | 5.765311 .4636052 12.44 0.000 4.856568 6.674054 loss | 7.203929 .7718708 9.33 0.000 5.690934 8.716924 size | 3.431771 .3430987 10.00 0.000 2.759241 4.104302 income | -1.822826 .2685361 -6.79 0.000 -2.349201 -1.296451 lev | .0290545 .0130789 2.22 0.026 .0034177 .0546913 total_asse~e | -2.134841 .8076954 -2.64 0.008 -3.718058 -.5516235 eps | -3.607401 .7401976 -4.87 0.000 -5.058311 -2.156491 jian_ren | .2132241 .6438449 0.33 0.741 -1.048819 1.475267 ind | -2.45725 3.275423 -0.75 0.453 -8.877624 3.963124 liquidity | 5.176242 1.480378 3.50 0.000 2.274455 8.078029 state | -.6270945 1.06994 -0.59 0.558 -2.724356 1.470166 shanghai | -.9304403 .4288382 -2.17 0.030 -1.771034 -.0898462 shenzhen | (omitted)

finance | -16.92903 3.26831 -5.18 0.000 -23.33546 -10.52259 utilities | -13.03564 2.592124 -5.03 0.000 -18.11663 -7.954643 properties | -14.50645 2.62843 -5.52 0.000 -19.65861 -9.354287 conglomera~s | -8.519407 2.533315 -3.36 0.001 -13.48512 -3.553688 industrails1 | -9.523898 3.261626 -2.92 0.004 -15.91723 -3.130569 industrails2 | -9.691693 2.660096 -3.64 0.000 -14.90592 -4.477462 industrails3 | -10.81339 2.716238 -3.98 0.000 -16.13767 -5.48911 industrails4 | -18.19052 3.051069 -5.96 0.000 -24.17112 -12.20992 industrails5 | -13.64426 2.557115 -5.34 0.000 -18.65663 -8.631894 industrails6 | -11.45386 2.717633 -4.21 0.000 -16.78087 -6.126846 industrails7 | -14.96557 2.584725 -5.79 0.000 -20.03206 -9.899077 industrails8 | -11.29803 2.534431 -4.46 0.000 -16.26594 -6.330123 industrails9 | -14.31667 3.120429 -4.59 0.000 -20.43323 -8.200108 industrai~10 | -12.46433 2.681418 -4.65 0.000 -17.72036 -7.208306 industrai~11 | -7.629642 2.709243 -2.82 0.005 -12.94021 -2.319077 industrai~12 | (omitted)

industrai~13 | -12.65095 3.621808 -3.49 0.000 -19.75029 -5.551602 industrai~14 | -11.2972 4.487266 -2.52 0.012 -20.09298 -2.501414 commerce | -7.513532 2.576844 -2.92 0.004 -12.56457 -2.462489 y2001 | (omitted)

y2002 | 2.572041 1.088706 2.36 0.018 .4379954 4.706086 y2003 | 4.540229 1.250367 3.63 0.000 2.089301 6.991157 y2004 | 4.363275 1.286931 3.39 0.001 1.840676 6.885873 y2005 | 6.295877 1.291748 4.87 0.000 3.763835 8.827918 y2006 | 8.128384 1.332769 6.10 0.000 5.515935 10.74083 y2007 | 7.270314 1.383378 5.26 0.000 4.558663 9.981964 y2008 | 6.642933 1.369221 4.85 0.000 3.959032 9.326833 y2009 | 3.321235 1.46637 2.26 0.024 .4469064 6.195564 y2010 | 4.957627 1.489732 3.33 0.001 2.037505 7.877748

_cons | 54.78666 4.711119 11.63 0.000 45.55208 64.02123 ------------------------------------------------------------------------------

本文来源:https://www.bwwdw.com/article/7t6h.html

Top