[R] Not sure this is something R could do but it feels like it should be.

David Winsemius dwinsemius at comcast.net
Sun Jun 9 19:09:06 CEST 2013

On Jun 9, 2013, at 6:14 AM, Calum Polwart wrote:

>>> Calum
>> Hi Calum,
>> I can only answer from the perspective of someone who calculated
>> doses of alcohol for experimental subjects many years ago. It was not
>> possible to apply a linear function across the range due to a number
>> of factors. One is that BAC, which was the target value, is dependent
>> upon the proportion of the weight that represents the water
>> compartment of the body. This varies with both weight (heavier people
>> typically have a higher proportion of fat) and sex (women also tend to
>> have slightly more fat). The real monkey wrench in the works was
>> absorption rate, which often made nonsense of my calculations. This
>> may not be as important in therapeutic drugs, for we were aiming at a
>> specified BAC at a certain time after dosing rather than an average
>> level.
> All those things affect therapeutic dosing.
> I may have oversimplified what we are trying to achieve to avoid getting bogged down in the detail of what we are trying to achieve and provide something people might be able to relate to.
> However, we can assume that they are already sorted out, so we know the theoretically know what the 'correct' dose is for a patient.  The hard bit is unless you want to give everyone liquid so you can measure any dose possible you have to have a dose that is a multiple of something (Amoxicillin doses in adults are multiples of 250 because thats the size of the capsule).

I think you may have under-simplified rather than over-simplified. There is no such thing as getting "bogged down in detail". We need all the relevant details. I suspect that you have in mind a situation where you have multiple drugs and multiple forms in which they can be administered and are hoping for a processing method that "rounds" to the nearest tespoonful or tablet size given some set of patient specific factors such as age sex height or weight. If my guess is correct then you need to offer a sample set of data of at least theree types for A) drugs and phamacokinetic parameters, B) dosage forms, C) patient features. You also need to supply rules for "rounding" to he nearest "nice" unit of administration.

> What we are trying to do is determine the most appropriate number to make the capsules.  (Our dosing is more complex but lets stick to something simple.  I can safely assure you that vritually no-one actually needs 250 or 500mg as a dose of amoxicillin... ...thats just a dose to get them into a therapeutic window, and I'm 99% certain 250 and 500 are used coz they are round numbers.  if 337.5 more reliably got everyone in the window without kicking anyone out the window that'd be a better dose to use!  So... what I'm looking to do is model the 'theoretical dose required' (which we know) and the dose delivered using several starting points to get the 'best fit'.  We know they need to be within 7% of each other, but if one starting point can get 85% of doses within 5% we think that might be better than one that only gets 50% within 5%.
>> However, I suspect that many therapeutic drugs have a different
>> dose by weight for children (we weren't dosing children) and choosing
>> a starting point at the bottom of the range would almost certainly
>> introduce a systematic error. My intuition would be to anchor the
>> dosage rate in the middle of the scale and then extrapolate in both
>> directions (adults only, of course).
> We are actually using a starting point that may be middle and going up and down if need be.

You need to describe explicitly how that determination is made.
> I think what we may want to do is run a loop through each weight (in 1kg increments) and calculate their theoretical dose, and the dose for each possible starting point (there are certain contraints on that already so there may only be 20 possible start points), then we calculate the % variance for each dose to theoretical dose and calculate the Area Under & Above (some will be negative) the curve and the one that has the lowest AUC is then the one that most "precisely" will dose the patient…?

I think you need to classify what pharmacokinetics apply to a particular drug (zeroth,  or first order kinetics, volume of distribution affected by <whatever>) and choose from a limited number of heuristics for drugs rahter than solving each case from first principles.

David Winsemius
Alameda, CA, USA

More information about the R-help mailing list