# fitting an exponential decay onto a regression line

I have data for adherence to medicines which follows a downward linear trend for about 6 months (from 100%) and then plateaus at about 50%. Another way of describing it is by saying that adherence reaches steady state (=50%) at about 6 months after starting a medicine (http://www.ncbi.nlm.nih.gov/pubmed/12132975).

I have been exploring the effect of an intervention on adherence to medicines and have been using a longitudinal study design and a linear model to do this. However, I would like to try fit an exponential decay into the model to see if I can improve the fit. I'm using geeglm in R.

My original model is straightforward

y= Bo + B1(time) +B2(trt group) + B3(post) + B4 (time_post) +b5(posttrt_group) + B6 (time_posttrt_group)

where post= the intervention occurring at a defined point in time (change in intercept) time_post = change in slope after the intervention.

A function that may work to fit the decay is

A+Be-kt

where A = value at plateau (estimate at 50%) B = difference between plateau value and original intercept value (intercept should typicall be 100% - so B=50%) -k = elimination rate constant t = time

I'm not sure how I would fit this into my model. If anyone has any suggestions for how I could work this out, or could point me to some web-help, that would be really helpful.

Thank you. • Have you tried fitting using multiple nonlinear least squares regression? Jul 9, 2014 at 18:02
• I strongly recommend reading this: mathworks.com/help/stats/… Jul 9, 2014 at 18:19
• @Alexis - thanks for the tip just read some useful stuff here walkingrandomly.com/?p=5254. I would like to stick to GEE though, as I need to allow for repeated measures on individuals. I guess my main problem is the practical issue of writing the function into the model. TrynnaDoStat - thank you for your suggestion also. from what I've read based on your suggestions i need something like this: geeglm(Y ~ (A+Bexp(ktime)) +trt_group + post + time_post + trt_group:post + trt_group:time_post, family = etc etc..... Unfortunately this is wrong! Any clues on what is up with my logic? Jul 9, 2014 at 18:41
• Right tool for the job: accounting for repeated measures design with nonlinear functional relationships using nonlinear mixed models. For example using lme4 as described here: lme4.r-forge.r-project.org/slides/2009-07-01-Lausanne/… Jul 9, 2014 at 19:18
• @Alexis - The Michaelis-Menten model..... i never thought I'd have to look at it again after my days in the lab finished up! Thanks for this suggestion - reading now. Jul 9, 2014 at 19:55