gvkey datadate fyear cf
001000 31dec1977 1977 .0636002
001000 31dec1972 1972 .1093585
001000 31dec1973 1973 .1282899
001000 31dec1975 1975 .1513073
001000 31dec1974 1974 .1255558
001000 31dec1971 1971 .0475622
001000 31dec1976 1976 .1299953
这是数据包中截取的一个公司的数据。
计算每个公司的cf(cash flow)每10年的方差,必须至少要有3年的cf数据存在,否则设为缺失值
(calculate the standard deviation of cash flow for the previous 10 years(same firm), requiring at least 3 years data available,otherwise set sd as missing)
公司名是 gvkey
bys gvkey: egen sd=sd(cf) if cf!=0
请教一下如何编时间上的条件限制?


雷达卡



京公网安备 11010802022788号







