# Controlling for number of days when calculating medication adherence

I am trying to evaluate the success of a medication adherence intervention. I am trying to assess the success of the program before and after the intervention in terms of number of days a patient took the medication relative to how long they were observed (i.e. # of days medication was taken / # of days observed). The challenge I have is that periods of observations (before and after the program)is different for every patient in the data set.

I would like to control for the number of days to make the assessment to see the actual impact.

One way I thought of doing this is to normalize the data (using min/max) for each patient before and after the program. For instance for the observations before the intervention, I would take the max and min number of days observed before intervention among all the patients and normalize the days medication taken and days observed for each patient (to get it between 1 and 0). Similarly I would do the same for post intervention observations (with min/max of days observed of post intervention).

I am wondering if this is logically correct? One reason I could be wrong is that I am taking the range of "days observed" and using that to normalize "days medication taken". Any suggestions or thoughts?

This should be treated as a longitudinal binary Y problem with a flexible nonlinear time trend. It can be misleading to just summarize with a ratio because adherence tends to be higher early and lower late. The time trend can be e.g. a regression spline, and Y=0,1 can be assessed daily or weekly. Then use a Markov model or a random effects model. See here for more. Such a model will allow you to estimate the probability of adherence as a function of time and patient baseline characteristics. This provides much more information than a univariate ignore-time-trends analysis.

• Thanks for help! Dec 31, 2023 at 5:18

Why not just a linear regression of y on x, where:

y: measure of medication success (e.g. % improvement). x: # of days medication was taken / # of days observed

Maybe if (# days observed) < (some threshold), discard those observations, e.g. if you observed them for 1 day and they took the medication for 1 day, probably won't do much, so maybe establish some lower bound.

• Thank you, agree with discarding values below a certain threshold.. Dec 29, 2023 at 7:05
• thank you, agree with discarding values below a certain threshold..will think about the linear regression approach..my initial thoughts are that since medication success in this case is also defined as the difference of (# of days med taken/# days of observed) before and after the intervention, this might not help normalize it for different time periods Dec 29, 2023 at 7:25
• Respecting the longitudinal nature of the data will make interpretation clear, do away with the need to ignore patients with short follow-up, and make the assumptions clear (e.g., missingness at random). Dec 31, 2023 at 7:50