___ ____ ____ ____ ____ tm /__ / ____/ / ____/ ___/ / /___/ / /___/ 9.0 Copyright 1984-2005 Statistics/Data Analysis StataCorp 4905 Lakeway Drive College Station, Texas 77845 USA 800-STATA-PC http://www.stata.com 979-696-4600 stata@stata.com 979-696-4601 (fax) 3-user Stata for Linux64 (network) perpetual license: Serial number: 999 Licensed to: Brian P. Poi, Ph.D. StataCorp LP Notes: 1. (-m# option or -set memory-) 1.00 MB allocated to data 2. Command line editing disabled 3. Stata running in batch mode running /home/bpp/bin/profile.do ... . do boxbod.do . /* NIST/ITL StRD > Dataset Name: BoxBOD (BoxBOD.dat) > > File Format: ASCII > Starting Values (lines 41 to 42) > Certified Values (lines 41 to 47) > Data (lines 61 to 66) > > Procedure: Nonlinear Least Squares Regression > > Description: These data are described in detail in Box, Hunter and > Hunter (1978). The response variable is biochemical > oxygen demand (BOD) in mg/l, and the predictor > variable is incubation time in days. > > > Reference: Box, G. P., W. G. Hunter, and J. S. Hunter (1978). > Statistics for Experimenters. > New York, NY: Wiley, pp. 483-487. > > > > > > Data: 1 Response (y = biochemical oxygen demand) > 1 Predictor (x = incubation time) > 6 Observations > Higher Level of Difficulty > Observed Data > > Model: Exponential Class > 2 Parameters (b1 and b2) > > y = b1*(1-exp[-b2*x]) + e > > > > Starting values Certified Values > > Start 1 Start 2 Parameter Standard Deviation > b1 = 1 100 2.1380940889E+02 1.2354515176E+01 > b2 = 1 0.75 5.4723748542E-01 1.0455993237E-01 > > Residual Sum of Squares: 1.1680088766E+03 > Residual Standard Deviation: 1.7088072423E+01 > Degrees of Freedom: 4 > Number of Observations: 6 > */ . . clear . . scalar N = 6 . scalar df_r = 4 . scalar df_m = 2 . . scalar rss = 1.1680088766E+03 . scalar rmse = 1.7088072423E+01 . . scalar b1 = 2.1380940889E+02 . scalar seb1 = 1.2354515176E+01 . scalar b2 = 5.4723748542E-01 . scalar seb2 = 1.0455993237E-01 . . qui input double(y x) . . nl ( y = {b1}*(1-exp(-{b2}*x)) ), init(b1 1 b2 1) eps(1e-10) (obs = 6) Iteration 0: residual SS = 186382.4 Iteration 1: residual SS = 184700 Iteration 2: residual SS = 13388.66 Iteration 3: residual SS = 7327.64 Iteration 4: residual SS = 2375.331 Iteration 5: residual SS = 1388.389 Iteration 6: residual SS = 1168.01 Iteration 7: residual SS = 1168.009 Iteration 8: residual SS = 1168.009 Iteration 9: residual SS = 1168.009 Iteration 10: residual SS = 1168.009 Iteration 11: residual SS = 1168.009 Iteration 12: residual SS = 1168.009 Iteration 13: residual SS = 1168.009 Iteration 14: residual SS = 1168.009 Iteration 15: residual SS = 1168.009 Source | SS df MS Number of obs = 6 -------------+------------------------------ F( 2, 4) = 320.44 Model | 187140.991 2 93570.4956 Prob > F = 0.0000 Residual | 1168.00888 4 292.002219 R-squared = 0.9938 -------------+------------------------------ Adj R-squared = 0.9907 Total | 188309 6 31384.8333 Root MSE = 17.08807 Res. dev. = 48.65504 ------------------------------------------------------------------------------ y | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- b1 | 213.8094 12.35451 17.31 0.000 179.5078 248.111 b2 | .5472375 .10456 5.23 0.006 .2569325 .8375425 ------------------------------------------------------------------------------ (SEs, P values, CIs, and correlations are asymptotic approximations) . . assert N == e(N) . assert df_r == e(df_r) . assert df_m == e(df_m) . . lrecomp _b[b1] b1 _b[b2] b2 () /* > */ _se[b1] seb1 _se[b2] seb2 () /* > */ e(rmse) rmse e(rss) rss _b[b1] 7.9 _b[b2] 7.3 ------------------------- min 7.3 _se[b1] 6.8 _se[b2] 6.7 ------------------------- min 6.7 e(rmse) 11.1 e(rss) 10.4 . . end of do-file