1

I fitted a simple Imax model of the form: Y = I0 - [(Imax*X)/(IC50 + X)] using nls function in R. Using a measured Y = 'n', I estimated X = 'm'. Is there a function in R to compute 95% confidence intervals around 'm'?

Thank you!

  • 2
    Can you provide a reproducible example of your dataset and of the code you have try so far ? (see this link: https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) – dc37 Feb 22 '20 at 02:47

1 Answers1

1

See invest in the investr package.

G. Grothendieck
  • 254,981
  • 17
  • 203
  • 341
  • predictNLS gives confidence interval (CI) around future prediction of 'Y' at an observed 'X' value. My question is how to obtain the CI around future prediction of 'X' at a measured value of 'Y'. I tried flipping the model and fitted X = IC50*(I0-Y)/(Imax - I0 +Y). However, the estimates of IC50, I0 and Imax obtained were quite different from the original fitting and hence couldn't proceed further. – Abhinav Kurumaddali Feb 22 '20 at 04:02
  • Have revised answer. – G. Grothendieck Feb 22 '20 at 04:17
  • mod <- nls(weight ~ theta1/(1 + exp(theta2 + theta3 * log(conc))), start = list(theta1 = 1000, theta2 = -1, theta3 = 1), data = nasturtium) invest(mod, y0 = c(309, 296, 419), interval = "inversion") estimate lower upper 2.263854 1.772244 2.969355 modc <- coef(mod) > modc[1]/(1 + exp(modc[2] + modc[3] * log(2.263854))) theta1 341.333 – Abhinav Kurumaddali Feb 22 '20 at 11:47
  • invest(mod, y0 = c(309), interval = "inversion") Error: Upper confidence limit not found in the search interval (0, 4). Try tweaking the values of lower and upper. Use plotFit for guidance. I only have one observed mean response 'y0'. But, in this case it looks like one need to specify upr and lwr of 'y0' to get output. Back calculation gives x0=341.333 while original x0=309. – Abhinav Kurumaddali Feb 22 '20 at 11:55
  • > invest(mod, y0 = c(309,309,309), interval = "inversion") estimate lower upper 2.541097 1.974054 3.394131 > modc[1]/(1 + exp(modc[2] + modc[3] * log(2.541))). theta1 309.0102. Got this. Those are indeed replicates of y0. If all the 3 replicates = 309, I am able to reproduce it by back calculation. – Abhinav Kurumaddali Feb 22 '20 at 12:03