##
## Nasturtium example (nonlinear regression with replication)
##
## Log-logistic model
mod <- nls(weight ~ theta1/(1 + exp(theta2 + theta3 * log(conc))),
start = list(theta1 = 1000, theta2 = -1, theta3 = 1),
data = nasturtium)
plotFit(mod, lwd.fit = 2)
## Compute approximate 95\% calibration intervals
invest(mod, y0 = c(309, 296, 419), interval = "inversion")
invest(mod, y0 = c(309, 296, 419), interval = "Wald")
## Bootstrap calibration intervals. In general, nsim should be as large as
## reasonably possible (say, nsim = 9999).
boo <- invest(mod, y0 = c(309, 296, 419), boot = TRUE, nsim = 999,
seed = 101)
boo # print bootstrap summary
plot(boo) # plot results
Run the code above in your browser using DataLab