chenlongjie2003 发表于 2015-2-2 14:39 
先按照id 把zyear merge过来,然后gen age=year-zyear
详见help merge
谢谢,我试了一下,用的 merge 1:1 stock using age.dta,keep(1 3)语句,可是出现了下面这个错误
variable stock does not uniquely identify observations in the master data
意思是说我的主表里,stock相同的不止一个,因为每个stock还分年份的,但是来源表(企业年龄)只有stock,没有year,不知道该怎么办