全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
6106 5
2014-02-16
求助:同一公司如审计师事务所年度间发生变化为1,否则为0,怎么写程序。我用tab audifirm,gen(aud)生成虚拟变量后,不知道怎么判断发生变化了(无法达到母的),或者是有别的方法,谢谢了。注会计师事务所很多家


二维码

扫码加我 拉你入群

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

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

全部回复
2014-2-16 11:32:37
one approach is to generate a numerical id variable, naudifirm, for each audifirm, then use
egen x=std(naudifirm), by(company)

if x!=0 the company has different audifirm across year, otherwise, has the same audifirm.

二维码

扫码加我 拉你入群

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

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

2014-2-16 14:53:27
十分感谢,太强了
二维码

扫码加我 拉你入群

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

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

2014-2-16 15:19:21
本来就有变量code区别公司的,但一个公司每年度审计的公司(audfirm)可能不同,用你给的命令还是没有办法判定这个公司t-1年与t年的审计公司不同为1,相同为0啊,亲
请再次执教,谢谢
二维码

扫码加我 拉你入群

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

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

2014-2-16 15:23:07
审计公司是字符型数据,包括200多家公司的名称,code是数值型数据
二维码

扫码加我 拉你入群

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

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

2014-2-16 22:54:27
if the standard deviation of audfirm is 0 for a a company across years, the company has the same audfirm.  Do you want to see if the company has the same audfirm between two consecutive years or across all years?  To see by consecutive years, do

sort company year
gen x=1 if audifirm!=audifirm[_n-1] & company==company[_n-1]
replace x=0 if x==.
二维码

扫码加我 拉你入群

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

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

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

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