Hi, I'm playing around with data
Dataconsists of intervention, vehicle no, visitno - no of times the
car went to the MOT.
I would like to detect the max for brake and oil, for each time an intervention took
place. This would mean taking the max of the preceeding values of the same vehicleno
DATA:
I tried:
collapse (max) brake oil, by (vehicleno intrevention)
But then this wouldn't give me vehicleno: 4 episode 2-4
So ideally data would look like this:
Dataconsists of intervention, vehicle no, visitno - no of times the
car went to the MOT.
I would like to detect the max for brake and oil, for each time an intervention took
place. This would mean taking the max of the preceeding values of the same vehicleno
DATA:
Code:
* Example generated by -dataex-. For more info, type help dataex clear input float(intervention vehicleno episodeno brake oil) . 1 1 1 0 110 1 2 1 0 . 2 1 0 1 . 2 2 0 1 112 2 3 1 1 . 3 1 0 1 113 3 2 0 1 114 4 1 1 0 . 4 2 1 0 . 4 3 1 1 115 4 4 1 1 end
collapse (max) brake oil, by (vehicleno intrevention)
But then this wouldn't give me vehicleno: 4 episode 2-4
So ideally data would look like this:
Code:
* Example generated by -dataex-. For more info, type help dataex clear input float(intervention vehicleno episodeno brake oil) str1(maxBRAKE maxOIL) . 1 1 1 0 "" "" 110 1 2 1 0 "1" "0" . 2 1 0 1 "" "" . 2 2 0 1 "" "" 112 2 3 1 1 "1" "1" . 3 1 0 1 "" "" 113 3 2 0 1 "0" "1" 114 4 1 1 0 "1" "0" . 4 2 1 0 "" "" . 4 3 1 1 "" "" 115 4 4 1 1 "1" "" end
Comment