Compliance analysis for taking medication