## Not run:
# library(intubate)
# library(magrittr)
# library(nlreg)
#
#
# ## ntbt_nlreg: Fit a Nonlinear Heteroscedastic Model via Maximum Likelihood
# library(boot)
# data(calcium)
#
# ## Original function to interface
# nlreg(cal ~ b0*(1-exp(-b1*time)), weights = ~ ( 1+time^g )^2,
# start = c(b0 = 4, b1 = 0.1, g = 1), data = calcium, hoa = TRUE)
#
# ## The interface puts data as first parameter
# ntbt_nlreg(calcium, cal ~ b0*(1-exp(-b1*time)), weights = ~ ( 1+time^g )^2,
# start = c(b0 = 4, b1 = 0.1, g = 1), hoa = TRUE)
#
# ## so it can be used easily in a pipeline.
# calcium %>%
# ntbt_nlreg(cal ~ b0*(1-exp(-b1*time)), weights = ~ ( 1+time^g )^2,
# start = c(b0 = 4, b1 = 0.1, g = 1), hoa = TRUE)
# ## End(Not run)
Run the code above in your browser using DataLab