3

I've used "nls" to fit a logistic equation to some Drug-Receptor binding data;

Y= 100/(1+B*Exp(-k*X))

The process seems to have worked well (see graph)

nls fit of drug-receptor binding data

I have the estimates of B and k (the constants from my equation) and I want to use these to estimate the Log EC50 value for the agonist (drug). I can do that easily with a rearrangement of the equation, when Y=50, X=ln(1/B)/-k. The problem I have is getting the values of B and k into that rearranged equation- how do I call the parameters (B and k) from the nls model that estimated them for me?

Ben Bolker
  • 211,554
  • 25
  • 370
  • 453
G Boyd
  • 43
  • 2
  • It would be easier to help if you provided a [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input data. Normally you'd do things liek this with the `predict()` function. – MrFlick Oct 30 '17 at 15:03
  • 1
    A note - if you want to get confidence intervals for this quantity you might want to research the [delta method](https://en.wikipedia.org/wiki/Delta_method) – Dason Oct 30 '17 at 15:14

1 Answers1

4

Use coef().

Try

with(as.list(coef(model)),log(1/B)/(-k))

as a shortcut for

cc <- coef(model)
log(1/cc["B"])/(-cc["k"])
Ben Bolker
  • 211,554
  • 25
  • 370
  • 453
  • Sorry Ben, I was trying -honest! but it kept telling me that I couldn't accept an answer for another three minutes. I've now accepted the answer. Thanks again for your help. – G Boyd Oct 30 '17 at 15:16