Using the function bent.cable in the SiZer package in R, one can fit a "bent cable model" in R.

Here is an example of how I used it and the plot it made.

model.bc.mean=bent.cable(flow.new.sum.dat$l2Flow,flow.new.sum.dat$TCTmean,grid.size =200)

x.grid <- seq(min(flow.new.sum.dat$TCTmean), max(flow.new.sum.dat$TCTmean), length=77)

x.grid looks like 0.00100 , 0.2485, 0.4961,...., 18.56, 18.816

lines(x.grid, predict(model.bc.mean, x.grid), col='red')

it looks like this:enter image description here

The question I have now is how to derive confidence bounds for this model. Using the standard predict function does not work, nor does using predict.nls. Basically I want to derive confidence intervals for the above regression line. Any ideas/packages/suggestions? Thanks

  • 1
    $\begingroup$ FWIW, the lack of fit is so clear and large that confidence intervals aren't worth much. This model appears to employ at least four parameters; with that many parameters you can achieve a much better fit with other models. What is the reason for choosing this one? $\endgroup$ – whuber Oct 22 '19 at 20:48
  • $\begingroup$ The reason is that there should be a "limit of detection" whereby after a certain x-value we obtain y values of 0 or near 0. As it relates to a biological process. $\endgroup$ – Quality Oct 22 '19 at 20:51
  • $\begingroup$ That's a reason to select an appropriate model, but it's not a reason to select this one. The scientific theory of this biological process will provide the best guide to selecting a model or family of models to fit to the data. $\endgroup$ – whuber Oct 23 '19 at 14:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.