I am using a nonlinear model of the form y ~ p1 * exp(-p2*A), with the following coefficients:

     estimate     se  zval    pval
p1     5.5447 4.2592 1.302 0.19298
p2     0.3856 0.0835 4.616 0.00000
tau2   0.0000     NA    NA      NA

I want to use this model to predict the effect size (in %) of a treatment, influenced by the variable A. Let's assume, for example, this is the effectiveness of a cancer treatment at a certain age A. For example, when A= 9, effect size is ~19%:

make_pct <- function(x) (exp(x) - 1) * 100
> make_pct(5.5447 * exp (-0.3856 * 9))
[1] 18.82309

The problem is that now I don't know how to calculate the standard error at e.g. A=9 using this model. I am sure this is very basic but I don't have any experience in this particular matter. Thanks



If a function (of the final results) depends more on a given variable, then the final error should depend more on the error of this variable. The way to measure how a function depends on a variable $x$ is to calculate derivative $\frac{\partial f}{\partial x}$. So final error should be some kind of weighted sum of errors of all variables with weights that are those dependence measures.

Actually one does not use a simple sum, but square root of sum of squares (there are many reason behind this, e.g. signs of derivatives).


Let me introduce following notation for your function:

$ y(a, b, t) = a \exp(-b t) $

and let's denote standard error of a $x$ by $\delta(x)$


$ \delta(y) = \sqrt{(\frac{\partial y}{\partial a} \times \delta(a))^2 + (\frac{\partial y}{\partial b} \times \delta(b))^2 + (\frac{\partial y}{\partial t} \times \delta(t))^2 } $

The derivatives are following:

$ \frac{\partial y}{\partial a} = \exp(-b t) $

$ \frac{\partial y}{\partial b} = - a t \exp(-b t) $

$ \frac{\partial y}{\partial t} = - a b \exp(-b t) $

So now you just have to use values you have and that's it. It seems that $t$ you know exactly, so you just put $\delta(t) = 0$


Why do you call variables by $p1$ and $p2$? There is much more enjoyable letters in alphabet, no need to use misleading number indices...

| cite | improve this answer | |
  • $\begingroup$ This would only be true if the parameter estimators were uncorrelated, which they aren't. $\endgroup$ – DeltaIV Jan 18 '18 at 20:59

Not the answer you're looking for? Browse other questions tagged or ask your own question.