Orange                  package:nls                  R Documentation

_G_r_o_w_t_h _o_f _o_r_a_n_g_e _t_r_e_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     The `Orange' data frame has 35 rows and 3 columns of records of
     the growth of orange trees.

_F_o_r_m_a_t:

     This data frame contains the following columns:

     _T_r_e_e an ordered factor indicating the tree on which the
            measurement is made.  The ordering is according to
            increasing maximum diameter.

     _a_g_e a numeric vector giving the age of the tree (days since
            1968/12/31)

     _c_i_r_c_u_m_f_e_r_e_n_c_e a numeric vector of trunk
            circumferences (mm).  This is probably ``circumference at
            breast height'', a standard measurement in forestry.

_S_o_u_r_c_e:

     Draper, N. R. and Smith, H. (1998), Applied Regression Analysis
     (3rd ed), Wiley (exercise 24.N).

     Pinheiro, J. C. and Bates, D. M. (2000) Mixed-effects Models in S
     and S-PLUS, Springer.

_E_x_a_m_p_l_e_s:

     library(nls)
     data(Orange)
     coplot(circumference ~ age | Tree, data = Orange, show = FALSE)
     fm1 <- nls(circumference ~ SSlogis(age, Asym, xmid, scal),
                data = Orange, subset = Tree == 3)
     plot(circumference ~ age, data = Orange, subset = Tree == 3,
          xlab = "Tree age (days since 1968/12/31)",
          ylab = "Tree circumference (mm)", las = 1,
          main = "Orange tree data and fitted model (Tree 3 only)")
     age <- seq(0, 1600, len = 101)
     lines(age, predict(fm1, list(age = age)))

