Algorithm 1:
The sampling algorithm.
| Input: A longitudinal dataset consisting of visit-level records for participants. For each participant , a visit set is denoted as , where indicates a number of total visits, including: participant ID and baseline demographics at , and cognitive impairment status, comorbidities and NPS indicators over time | |
| Output: Set of bootstrap samples with each dataset | |
| 1 | Initialize |
| 2 | for to 100 do |
| ββInitialize | |
| ββfor to do | |
| βββLet , sorted by time | |
| βββPartition | |
| βββLet status | |
| βββExtract baseline demographics from | |
| βββif then | |
| ββββRandom sample | |
| βββββ | |
| ββββRandom sample | |
| βββelse | |
| ββββRandom sample | |
| βββend if | |
| βββLet disease and NPS statuses from | |
| βββLet | |
| βββAppend to | |
| ββend for | |
| ββAppend to | |
| end for | |
| 3 | Return |