specific variables

  1. C

    Sum Rows of Specific Variable Based on two Conditions

    Please see example dataset below to best illustrate my goal. The cases that need to be changed are in red and blue (arbitrary color choices). I am cleaning a large dataset and I have about 2,500 duplicates. Basically, one patient (PtID) should never have more than one drug (DrugCode). So, I...