How do you use window functions like RANK(), LEAD(), and LAG() for longitudinal analysis of student or patient data?