I might not get the question correctly, but a simple solution could be to use the routines for identifying duplicate cases. In the menus, look for Data/Identify Duplicate Cases, and use ind_id and enc_date as "break variables". After that, set the Indicator of primary cases to "First case in each group is primary". The new variable/indicator is set to 1 for the first case and 0 for the repeats, but you can if needed use the recode procedure to set 0 to 2.
------------------------------
Robert Lundqvist
------------------------------
Original Message:
Sent: Sun February 23, 2025 09:40 PM
From: Lyndon Brooks
Subject: Identify replicate encounters of same individuals on the same day
The rows in my data file (cases) describe encounters (enc_id, numeric) of individuals (ind_id, numeric) on the dates on which they were ecountered (enc_date, date). I want to identify repeat encounters of the same individuals on the same days. For exmple if a new variable were created such the first encounter of an individual on a given day was idenfied as 1, and all repeats identified as 2, that would be all I needed. Counting repeats in the order of enc-id would be nice but unnecessary.
------------------------------
Lyndon Brooks
------------------------------