I've got data re cars , dummy dataset which I'm trying to practice on.
The faults could be either Brake failure/Engine failure/Oil failure/Wheelwear
If car had brake failure = 1 point
If car had oil failure = 1 point
If car had Wheelwear = 1 point
Therefore =
If car had brake failure + oil failure = 2 points
The question: - The key end point I'm interested in is engine failure
I want to find out if all those who had an engine failure, how may faulty car points did the car have previous to the engine failure (ie the summation of brake failure +/- oil failure +/- wheelwear)
I want to find out post engine failure, did the car get any faults in terms of wheel wear.
Could you kindly tell me what command I should use ? I can not for the life of me figure out the best way to go about it...
------------------ copy up to and including the previous line ------------------
Listed 6 out of 6 observations
The faults could be either Brake failure/Engine failure/Oil failure/Wheelwear
If car had brake failure = 1 point
If car had oil failure = 1 point
If car had Wheelwear = 1 point
Therefore =
If car had brake failure + oil failure = 2 points
The question: - The key end point I'm interested in is engine failure
I want to find out if all those who had an engine failure, how may faulty car points did the car have previous to the engine failure (ie the summation of brake failure +/- oil failure +/- wheelwear)
I want to find out post engine failure, did the car get any faults in terms of wheel wear.
Could you kindly tell me what command I should use ? I can not for the life of me figure out the best way to go about it...
Code:
* Example generated by -dataex-. For more info, type help dataex
clear
input double ID str10(AdmissionDate ReleaseDate) float(Faults brakefailure enginefailure oilfailure wheelwear)
123345672828373 "1 Jan 1960" "4 Jan 1960" 1 1 0 0 0
123345672828373 "1 Feb 1960" "4 Feb 1960" 3 0 1 0 0
13455633 "1 Apr 1960" "5 Apr 1960" 1 1 0 0 0
13455633 "5 Apr 1960" "7 Apr 1960" 2 0 0 1 0
13455633 "1 Nov 1960" "1 Nov 1960" 3 0 1 1 0
13455633 "1 Jan 1961" "3 Jan 1961" 1 0 0 0 1
end
Listed 6 out of 6 observations

Comment