# Example 1: Moderate Disease
# 20 stools total (7 days), Pain sum 10, Well-being sum 10, 1 Complication,
# Antidiarrheals yes, No mass, Hct 40 (Male -> 47-40=7), Weight 70 (Std 75 -> ~6.7% dev)
# Score = (20*2) + (10*5) + (10*7) + (1*20) + 30 + 0 + (7*6) + 6.7 = ~268.7
cdai_score(20, 10, 10, 1, 1, 0, 40, 70, 75, "male")
# Example 2: Remission
# 7 stools total, Pain sum 0, Well-being sum 0, No complications, No meds,
# No mass, Hct 42 (Female -> 0), Weight 60 (Std 60 -> 0)
# Score = 14 + 0 + 0 + 0 + 0 + 0 + 0 + 0 = 14
cdai_score(7, 0, 0, 0, 0, 0, 42, 60, 60, "female")
Run the code above in your browser using DataLab