文章预览
前情回顾 数据来源 清洗数据 Beat 运行时间约为1小时: cd C : \ Download
u er_relforcdate , clear
keep if Reptyp == 4
keep Stkcd y Act
sa _1 , replace
*
forv i = 1 / 3 {
u _1 , clear
g t = date ( A , "YMD" ) - ` i '
drop if mi ( t )
sa _1_ ` i ', replace
}
*
u 日收盘价_2023 , clear
g t = date ( T , "YMD" )
drop y
sa _2 , replace
*
forv i = 1 / 3 {
u _1_ ` i ', clear
joinby t S using _2
ren C C ` i '
sa _2_ ` i ', replace
}
*
u _2_1 , clear
g C = C1
forv i = 2 / 3 {
merge 1 : 1 S y using _2_ ` i ', nogen keepus(C*)
replace C = C ` i ' if mi(C)
}
keep S y C
merge 1 : 1 S y using _1 , nogen
ren C PreEA
g t = date ( A , "YMD" )
sa _3 , replace
*
u AnalystPriceForecast , clear
drop AnalystExperience FollowCoNumber For
………………………………