How would you use window functions to analyze changes in patient outcomes over time for Stanford University research?