___ ____ ____ ____ ____ (R) /__ / ____/ / ____/ ___/ / /___/ / /___/ 16.0 Copyright 1985-2019 StataCorp LLC Statistics/Data Analysis StataCorp 4905 Lakeway Drive Special Edition College Station, Texas 77845 USA 800-STATA-PC http://www.stata.com 979-696-4600 stata@stata.com 979-696-4601 (fax) 10-user Stata network perpetual license: Serial number: 1 Licensed to: Stata Developer StataCorp LLC Notes: 1. Stata is running in batch mode. 2. Unicode is supported; see help unicode_advice. 3. Maximum number of variables is set to 5000; see help set_maxvar. running /home/krg/bin/profile.do ... Compile number 785 . do ratkow2.do . /* NIST/ITL StRD > Dataset Name: Ratkowsky2 (Ratkowsky2.dat) > > File Format: ASCII > Starting Values (lines 41 to 43) > Certified Values (lines 41 to 48) > Data (lines 61 to 69) > > Procedure: Nonlinear Least Squares Regression > > Description: This model and data are an example of fitting > sigmoidal growth curves taken from Ratkowsky (1983). > The response variable is pasture yield, and the > predictor variable is growing time. > > > Reference: Ratkowsky, D.A. (1983). > Nonlinear Regression Modeling. > New York, NY: Marcel Dekker, pp. 61 and 88. > > > > > > Data: 1 Response (y = pasture yield) > 1 Predictor (x = growing time) > 9 Observations > Higher Level of Difficulty > Observed Data > > Model: Exponential Class > 3 Parameters (b1 to b3) > > y = b1 / (1+exp[b2-b3*x]) + e > > > > Starting Values Certified Values > > Start 1 Start 2 Parameter Standard Deviation > b1 = 100 75 7.2462237576E+01 1.7340283401E+00 > b2 = 1 2.5 2.6180768402E+00 8.8295217536E-02 > b3 = 0.1 0.07 6.7359200066E-02 3.4465663377E-03 > > Residual Sum of Squares: 8.0565229338E+00 > Residual Standard Deviation: 1.1587725499E+00 > Degrees of Freedom: 6 > Number of Observations: 9 > */ . . clear . . scalar N = 9 . scalar df_r = 6 . scalar df_m = 3 . . scalar rss = 8.0565229338E+00 . scalar rmse = 1.1587725499E+00 . . scalar b1 = 7.2462237576E+01 . scalar seb1 = 1.7340283401E+00 . scalar b2 = 2.6180768402E+00 . scalar seb2 = 8.8295217536E-02 . scalar b3 = 6.7359200066E-02 . scalar seb3 = 3.4465663377E-03 . . qui input double(y x) . . nl ( y = {b1} / (1+exp({b2}-{b3}*x)) ), init(b1 100 b2 1 b3 0.1) eps(1e-10) (obs = 9) Iteration 0: residual SS = 6184.434 Iteration 1: residual SS = 6178.702 Iteration 2: residual SS = 6175.971 Iteration 3: residual SS = 6167.185 Iteration 4: residual SS = 6164.692 Iteration 5: residual SS = 6142.645 Iteration 6: residual SS = 6111.21 Iteration 7: residual SS = 6028.496 Iteration 8: residual SS = 5985.768 Iteration 9: residual SS = 4696.54 Iteration 10: residual SS = 1943.7 Iteration 11: residual SS = 1210.456 Iteration 12: residual SS = 10.19422 Iteration 13: residual SS = 8.056614 Iteration 14: residual SS = 8.056523 Iteration 15: residual SS = 8.056523 Iteration 16: residual SS = 8.056523 Iteration 17: residual SS = 8.056523 Iteration 18: residual SS = 8.056523 Iteration 19: residual SS = 8.056523 Source | SS df MS -------------+---------------------------------- Number of obs = 9 Model | 18215.364 3 6071.78789 R-squared = 0.9996 Residual | 8.0565229 6 1.34275382 Adj R-squared = 0.9993 -------------+---------------------------------- Root MSE = 1.158773 Total | 18223.42 9 2024.82447 Res. dev. = 24.54421 ------------------------------------------------------------------------------ y | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- /b1 | 72.46224 1.734027 41.79 0.000 68.21923 76.70525 /b2 | 2.618077 .0882953 29.65 0.000 2.402026 2.834128 /b3 | .0673592 .0034466 19.54 0.000 .0589258 .0757926 ------------------------------------------------------------------------------ . . assert N == e(N) . assert df_r == e(df_r) . assert df_m == e(df_m) . . lrecomp [b1]_b[_cons] b1 [b2]_b[_cons] b2 [b3]_b[_cons] b3 () /* > */ [b1]_se[_cons] seb1 [b2]_se[_cons] seb2 [b3]_se[_cons] seb3 () /* > */ e(rmse) rmse e(rss) rss [b1]_b[_cons] 8.0 [b2]_b[_cons] 7.8 [b3]_b[_cons] 7.6 ------------------------- min 7.6 [b1]_se[_cons] 6.2 [b2]_se[_cons] 6.0 [b3]_se[_cons] 6.3 ------------------------- min 6.0 e(rmse) 10.4 e(rss) 11.8 . . end of do-file