Hey there,
I was wondering if you could help me with a problem I have with finding a nearest neighbor in SPSS.
So this is the data (in the attachment):
- On a certain moment (date with hh:mm:ss.ss configuration) TimeOfSCP happens
- This moment either happens when the Metronome is ON or OFF. By default it is OFF until someone switches it ON
- Moments on which it is switched ON or OFF are noted (date with hh:mm:ss.ss configuration), on random moments in time, with no consecutive order (it could be ON, ON, OFF, ON)
What I want is to create a new variable where the TimeOfSCP is labeled as a moment during which the metronome is ON or OFF. For example, SCP_ONOFF in which the outcome is ON or OFF.
Technically, this would be possible if SPSS would find the nearest neighbor of the TimeOfSCP that lies just before SCP happens, and then label the outcome as the variable itself (i.e. MetronomeOFF1). I can't seem to find a way to make this possible, so your help is much required!
*nice to know: this would help us improve CPR in cardiac arrest!
Kind regards, Lotte
------------------------------
Lotte Doeleman
------------------------------
#SPSSStatistics