data AA2_3;
set AA2;
/急加急减速判断存储于over属性,-3代表无效数据,1代表急加速,-1代表急减速,0代表正常速度/
if time_s > 2 then over = -3;/time_s剔除无效数据/
if time_s <= 2 then do ;/对满足时间条件的进行阈值判断/
if sign = 0 then over = 0;
if sign > 0 then do;
if gps_speed_ms <= 11.1111 then do;
if a_ms2 > 2.3568 then over = 1;
else over = 0;
end;
if gps_speed_ms > 11.1111 then do;
if a_ms2 > 1.3748 then over = 1;
else over = 0;
end;
end;
if sign < 0 then do ;
if gps_speed_ms <= 11.1111 then do;
if a_ms2 < -3.437 then over = -1;
else over = 0;
end;
if gps_speed_ms > 11.1111 then do;
if a_ms2 < -2.455 then over = -1;
else over = 0;
end;
end ;
end;
run;