Search code examples
rparametersnls

Is it possible to call nls parameters from a model?


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?


Solution

  • 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"])