Code:
* Example generated by -dataex-. For more info, type help dataex clear input float(intervention vehicleno episodeno oil var6) 1 1 1 0 . 110 1 2 0 1 1 2 1 1 . 1 2 2 1 . 112 2 3 1 1 1 3 1 1 . 113 3 2 1 1 114 4 1 0 1 1 4 2 0 . 1 4 3 1 . 115 4 4 1 1 end
Hi I would like to store data all on one line
Each time the car came to the car depot - registered as episodeno, if it had anything done to it - registered as intervention.
If it had an oil problem at any one time the vehicle went to the car depot registered as a 1.
I would now just like to clean my dataset and just keep all data stored on one line as I will be merging with another dataset using the 'intervention' as the variable used to merge
How do I create a column which if the vehicle had an oil failure at any episode it visited the car depot and for this to be stored on the line as the intervention?
Therefore appearing as 'var6'
Comment