plot.onls | R Documentation |
Plots an orthogonal nonlinear model obtained from onls
.
## S3 method for class 'onls' plot(x, fitted.nls = TRUE, fitted.onls = TRUE, segments = TRUE,...)
x |
an object returned from |
fitted.nls |
logical. If |
fitted.onls |
logical. If |
segments |
logical. If |
... |
other parameters to |
A plot of the onls
model.
Andrej-Nikolai Spiess
## Quadratic model with 10% added noise. ## Omitting the "nls" curve, ## display orthogonal segments. set.seed(123) x <- 1:20 y <- 10 + 3*x^2 y <- y + rnorm(20, 0, 50) DAT <- data.frame(x, y) mod <- onls(y ~ a + b * x^2, data = DAT, start = list(a = 10, b = 3), extend = c(0.2, 0)) plot(mod, fitted.nls = FALSE) ## Due to different scaling, ## orthogonality of fit is not evident. ## We need to have equal x/y-scaling for that, ## using asp = 1! plot(mod, fitted.nls = FALSE, xlim = c(0, 10), ylim = c(0, 200), asp = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.