# Example 1: Moderate Depression
# Several days (1) for most, More than half (2) for sleep/energy
phq9_score(1, 1, 2, 2, 1, 1, 1, 1, 0)
# Example 2: Severe Depression
# Nearly every day (3) for most items
phq9_score(3, 3, 3, 3, 2, 3, 2, 3, 1)
Run the code above in your browser using DataLab