# NOT RUN {
#' # feel free to ignore the following line<U+2014>it allows {broom} to supply
# examples without requiring the model-supplying package to be installed.
if (requireNamespace("quantreg", quietly = TRUE)) {
# load modeling library
library(quantreg)
# build artificial data with multiplicative error
set.seed(1)
dat <- NULL
dat$x <- rep(1:25, 20)
dat$y <- SSlogis(dat$x, 10, 12, 2) * rnorm(500, 1, 0.1)
# fit the median using nlrq
mod <- nlrq(y ~ SSlogis(x, Asym, mid, scal),
data = dat, tau = 0.5, trace = TRUE)
# summarize model fit with tidiers
tidy(mod)
glance(mod)
augment(mod)
}
# }
Run the code above in your browser using DataLab