BOD package:datasets R Documentation _B_i_o_c_h_e_m_i_c_a_l _O_x_y_g_e_n _D_e_m_a_n_d _D_e_s_c_r_i_p_t_i_o_n: The 'BOD' data frame has 6 rows and 2 columns giving the biochemical oxygen demand versus time in an evaluation of water quality. _U_s_a_g_e: BOD _F_o_r_m_a_t: This data frame contains the following columns: _T_i_m_e A numeric vector giving the time of the measurement (days). _d_e_m_a_n_d A numeric vector giving the biochemical oxygen demand (mg/l). _S_o_u_r_c_e: Bates, D.M. and Watts, D.G. (1988), _Nonlinear Regression Analysis and Its Applications_, Wiley, Appendix A1.4. Originally from Marske (1967), _Biochemical Oxygen Demand Data Interpretation Using Sum of Squares Surface_ M.Sc. Thesis, University of Wisconsin - Madison. _E_x_a_m_p_l_e_s: require(stats) # simplest form of fitting a first-order model to these data fm1 <- nls(demand ~ A*(1-exp(-exp(lrc)*Time)), data = BOD, start = c(A = 20, lrc = log(.35))) coef(fm1) print(fm1) # using the plinear algorithm fm2 <- nls(demand ~ (1-exp(-exp(lrc)*Time)), data = BOD, start = c(lrc = log(.35)), algorithm = "plinear", trace = TRUE) # using a self-starting model fm3 <- nls(demand ~ SSasympOrig(Time, A, lrc), data = BOD) summary( fm3 )