请选择 进入手机版 | 继续访问电脑版

草莓科研服务网——中国专业社科交流平台

 找回密码
 立即注册

快捷登录

查看: 1933|回复: 6

制造业上市公司机器人渗透度 (2011-2019)

[复制链接]
发表于 2022-8-4 08:24:40 | 显示全部楼层 |阅读模式


人工智能与机器人的兴起重塑了全球劳动力市场,也引起了学术界极大的研究热情。其中,经济学界最具代表性的人物无疑是 Daron Acemoglu,其撰写的几篇关于机器人的文章,基本都发表在诸如 AER,JPE,RES 等经济学顶刊上,尤其是 2020 年发表于 JPE 的 《Robots and jobs: Evidence from US labor markets》,短短两年间,引用量就超过了 2400 次。



中文期刊中,也有多篇关于机器人的文章见诸于《管理世界》、《经济研究》等顶级期刊,关于各种话题的研究纷纷涌现。

看到这个领域日趋火热,我们参考了王永钦、董雯 2020 年发表于《经济研究》一文的方法,计算了 2011-2019 年中国制造业上市公司的机器人渗透度,以飨读者。该数据为公司层面数据,并保留了公司和年份信息,可与上市公司的其他财务信息匹配,展开自己感兴趣的研究。



我们参考 Acemoglu and Restrepo (2020) 和 王永钦、董雯 (2010) 的做法,构造中国制造业企业层面的机器人渗透度指标。具体测算方法如下:

草莓科研服务网——中国专业社科交流平台:制造业上市公司机器人渗透度 (2011-2019)

其大致思路是,先计算出行业层面的单位从业人员的机器人数量 (机器人渗透度),随后再使用标准化的企业生产部门人数占比乘以行业机器人渗透度,两者的乘积即为该企业的机器人渗透度。

在计算过程中,我们需要解决几个核心问题,下面我们具体展开分析。


首先,我们要完成不同版本行业分类代码的衔接。这其中由分为两个部分,分别是《2002 版国民经济行业分类与代码》和《2011 版国民经济行业分类与代码》的衔接,以及中国的行业分类代码与 IFR 行业分类代码的衔接。参考王永钦、董雯 (2020) 的做法,我们先将中国的二位数制造业行业分类码统一至 2011 年,随后再与 IFR 进行匹配。

调整后的行业分类为:
草莓科研服务网——中国专业社科交流平台:制造业上市公司机器人渗透度 (2011-2019)

随后我们开始用Stata实现具体计算:

先确定工作路径:
  1. cd "~/Desktop/IFR to firm"
  2. global path "~/Desktop/IFR to firm"
  3. global raw_data "$path/raw_data"
  4. global result_data "$path/result_data"
复制代码


参考王永钦、董雯 (2020) 的测算方法,我们先计算出 2010 年中国各行业的从业人数。该数据来自于 CSMAR。

  1. import excel using "$raw_data/IND_Indstsvy.xlsx", firstrow clear
  2. labone, nrow(1 2)
  3. drop in 1/2
  4. keep Yeasgn Indcd Indnme Noemploy
  5. destring Yeasgn Indcd Noemploy, replace force
  6. keep if Yeasgn == 2010
  7. keep if inrange(Indcd, 13, 43)

  8. #delimit ;
  9. recode Indcd (13 14 15 16  = 1 "食品与饮料")
  10.              (17 18 19     = 2 "纺织与服装")
  11.              (20 21        = 3 "木材家具")
  12.              (22 23        = 4 "造纸印刷")
  13.              (24 42 43     = 5 "其他制造业")
  14.              (25/30        = 6 "塑料和化学制品")
  15.              (31           = 7 "玻璃、陶瓷、矿石制品")
  16.              (32 33        = 8 "基本金属")
  17.              (34           = 9 "金属制品")
  18.              (35 36        = 10 "机械设备制造")
  19.              (37           = 11 "汽车制造业和其他交通设备制造业")
  20.              (39/41        = 12 "电力设备与计算机、电子产品、光学产品制造"),
  21.              gen(industrycode);
  22. #delimit cr
  23. collapse (sum)labor = Noemploy, by(industrycode)
  24. save "$result_data/labor.dta", replace
复制代码
随后,我们导入 IFR 的机器人数据,并统一行业编码。
  1. use "$raw_data/IFR.dta", clear
  2. keep if country == "CN"
  3. keep if inrange(year, 2011, .)
  4. drop country Country installations
  5. gen industrycode = .
  6. replace industrycode = 1  if industry == "10-12"
  7. replace industrycode = 2  if industry == "13-15"
  8. replace industrycode = 3  if industry == "16"
  9. replace industrycode = 4  if industry == "17-18"
  10. replace industrycode = 5  if industry == "91"
  11. replace industrycode = 6  if industry == "19-22"
  12. replace industrycode = 7  if industry == "23"
  13. replace industrycode = 8  if industry == "24"
  14. replace industrycode = 9  if industry == "25"
  15. replace industrycode = 10 if industry == "28"
  16. replace industrycode = 11 if industry == "29" | industry == "30"
  17. replace industrycode = 12 if industry == "26-27"
  18. keep if !mi(industrycode)
  19. collapse (sum)stock = operation, by(industrycode year)
  20. save "$result_data/robot.dta", replace
复制代码
合并上述两份数据,计算行业层面的机器人渗透度:
  1. use "$result_data/robot.dta", clear
  2. merge m:1 industrycode using "$result_data/labor.dta", ///
  3.     keep(1 3) nogen
  4. gen density = stock / labor * 10000
  5. xtset industrycode year
  6. save "$result_data/robot_density.dta", replace
复制代码
我们导入 2011 年各制造业企业的生产部门员工占比,该数据来源于 Wind。
  1. import excel using "$raw_data/员工构成-2011年.xlsx", clear
  2. labone, nrow(1/2)
  3. drop in 1/2
  4. keep A B C R
  5. replace A = subinstr(A, ".SZ", "", .)
  6. replace A = subinstr(A, ".SH", "", .)
  7. destring A R, replace force
  8. gen year = real(substr(C, -4, .))
  9. drop C
  10. xtset A year
  11. rename (_all)(Stkcd ShortName product_share year)
  12. order Stkcd year
  13. drop if mi(Stkcd)
  14. format Stkcd %06.0f
  15. save "$result_data/employee_structure.dta", replace
复制代码
由于 Wind 并不提供上市公司的行业代码,我们从 CSMAR 下载了各企业的股票代码与行业分类码,并按照本文第二章所属的编码规则,对行业分类 recode
  1. import excel using "$raw_data/STK_LISTEDCOINFOANL.xlsx", firstrow clear
  2. labone, nrow(1 2)
  3. drop in 1/2
  4. gen year = real(substr(EndDate, 1, 4))
  5. gen listyear = real(substr(LIST, 1, 4))
  6. keep if ustrregexm(IndustryCode, "C")
  7. keep if inrange(year, 2011, 2019)
  8. clonevar Industrycode = IndustryCode
  9. replace Industrycode = subinstr(Industrycode, "C", "", .)
  10. destring Symbol Industrycode, replace force

  11. #delimit ;
  12. recode Industrycode
  13.     (13 14 15 16  = 1 "食品与饮料")
  14.     (17 18 19     = 2 "纺织与服装")
  15.     (20 21        = 3 "木材家具")
  16.     (22 23        = 4 "造纸印刷")
  17.     (24 41 42     = 5 "其他制造业")
  18.     (25/29        = 6 "塑料和化学制品")
  19.     (30           = 7 "玻璃、陶瓷、矿石制品")
  20.     (31 32        = 8 "基本金属")
  21.     (33           = 9 "金属制品")
  22.     (34 35        = 10 "机械设备制造")
  23.     (36 37 43     = 11 "汽车制造业和其他交通设备制造业")
  24.     (38/40        = 12 "电力设备与计算机、电子产品、光学产品制造"),
  25.     gen(industrycode);
  26. #delimit cr

  27. drop ListedCoID EndDate LISTINGDATE IndustryName
  28. rename Symbol Stkcd
  29. format Stkcd %06.0f
  30. order Stkcd year listyear
  31. save "$result_data/industrycode.dta", replace
复制代码


接下来,就是最终的计算结果了。我们先把前述所有数据 merge 到一起,包括 2011 年企业生产部门员工占比,和各行业的机器人渗透度。

随后,我们使用 egen 中的 mediam 计算出生产部门员工占比的中位数。

最后,将企业生产部门员工占比除以中位数,再乘以行业机器人渗透度 density,所得的 exposure 就是企业的机器人渗透度了。

  1. use "$result_data/industrycode.dta", clear
  2. merge m:1 Stkcd using "$result_data/employee_structure.dta", ///
  3.     keepusing(product_share) keep(1 3) nogen
  4. merge m:1 industrycode year using "$result_data/robot_density.dta", ///
  5.     keepusing(density) keep(1 3) nogen
  6. format %20.0g industrycode
  7. egen share_median = median(product_share)
  8. gen exposure = (product_share / share_median) * density

  9. label var density       "行业层面机器人渗透度(每万人)"
  10. label var product_share "生产部门员工占比"
  11. label var share_median  "生产部门员工占比中位数"
  12. label var exposure      "企业机器人渗透度"
  13. order Stkcd year
  14. xtset Stkcd year
  15. save "$result_data/exposure.dta", replace
复制代码





发表于 2022-8-9 08:35:35 | 显示全部楼层
好人一生平安,感谢楼主
回复

使用道具 举报

发表于 2023-5-15 13:34:14 | 显示全部楼层
可以分享一下最终数据吗?
回复

使用道具 举报

发表于 2023-5-24 15:21:47 | 显示全部楼层
感谢分享,好人一生平安!
回复

使用道具 举报

发表于 2023-6-20 12:52:10 | 显示全部楼层
分享的内容太棒了,感谢楼主
回复

使用道具 举报

发表于 2023-6-27 16:24:58 | 显示全部楼层
太棒了感谢楼主的慷慨解答
回复

使用道具 举报

发表于 2023-7-8 10:16:13 | 显示全部楼层
写的太好了!
回复

使用道具 举报

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

本版积分规则

回帖奖励

[详情]

  • * 每天自己主题被回复3次可获得额外5论坛币奖励。
  • * 每天回复他人主题5次可获得额外8论坛币的奖励。
  • * 奖励每天都可领取,一定要多参与论坛讨论哦。
  • * 同一主题的重复回复不计。
  • 草莓科研服务网——中国专业社科交流平台 ( 津ICP备2023000499号 )|网站地图

    GMT+8, 2025-3-22 10:30 , Processed in 0.086293 second(s), 60 queries .

    Copyright © caomeikeyan

    快速回复 返回顶部 返回列表