___ ____ ____ ____ ____ tm /__ / ____/ / ____/ ___/ / /___/ / /___/ 10.0 Copyright 1984-2007 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, PhD 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 misra1b.do . /* NIST StRD benchmark from http://www.nist.gov/itl/div898/strd/ > > Nonlinear Regression > > Difficulty=Lower Miscellaneous k=2 N=14 Observed > > Dataset Name: Misra1b (Misra1b.dat) > > Procedure: Nonlinear Least Squares Regression > > Description: These data are the result of a NIST study regarding > dental research in monomolecular adsorption. The > response variable is volume, and the predictor > variable is pressure. > > Reference: Misra, D., NIST (1978). > Dental Research Monomolecular Adsorption Study. > > > Data: 1 Response (y = volume) > 1 Predictor (x = pressure) > 14 Observations > Lower Level of Difficulty > Observed Data > > Model: Miscellaneous Class > 2 Parameters (b1 and b2) > > y = b1 * (1-(1+b2*x/2)**(-2)) + e > > > Starting values Certified Values > > Start 1 Start 2 Parameter Standard Deviation > b1 = 500 300 3.3799746163E+02 3.1643950207E+00 > b2 = 0.0001 0.0002 3.9039091287E-04 4.2547321834E-06 > > Residual Sum of Squares: 7.5464681533E-02 > Residual Standard Deviation: 7.9301471998E-02 > Degrees of Freedom: 12 > Number of Observations: 14 > */ . . clear . . scalar N = 14 . scalar df_r = 12 . scalar df_m = 2 . . scalar rss = 7.5464681533E-02 . scalar rmse = 7.9301471998E-02 . . scalar b1 = 3.3799746163E+02 . scalar seb1 = 3.1643950207E+00 . scalar b2 = 3.9039091287E-04 . scalar seb2 = 4.2547321834E-06 . . qui input double (y x) . . nl ( y = {b1} * (1 - (1 + {b2}*x/2)^(-2)) ), /// > init(b1 500 b2 0.0001) eps(1e-10) (obs = 14) Iteration 0: residual SS = 10785.32 Iteration 1: residual SS = 10479.89 Iteration 2: residual SS = 9334.394 Iteration 3: residual SS = 2473.437 Iteration 4: residual SS = 1841.777 Iteration 5: residual SS = .2369029 Iteration 6: residual SS = .133666 Iteration 7: residual SS = .0885158 Iteration 8: residual SS = .0754647 Iteration 9: residual SS = .0754647 Iteration 10: residual SS = .0754647 Iteration 11: residual SS = .0754647 Source | SS df MS -------------+------------------------------ Number of obs = 14 Model | 33059.5576 2 16529.7788 R-squared = 1.0000 Residual | .075464682 12 .006288723 Adj R-squared = 1.0000 -------------+------------------------------ Root MSE = .0793015 Total | 33059.6331 14 2361.40236 Res. dev. = -33.39379 ------------------------------------------------------------------------------ y | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- /b1 | 337.9975 3.164394 106.81 0.000 331.1028 344.8921 /b2 | .0003904 4.25e-06 91.75 0.000 .0003811 .0003997 ------------------------------------------------------------------------------ . . 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 () /* > */ [b1]_se[_cons] seb1 [b2]_se[_cons] seb2 () /* > */ e(rmse) rmse e(rss) rss [b1]_b[_cons] 10.0 [b2]_b[_cons] 9.9 ------------------------- min 9.9 [b1]_se[_cons] 6.5 [b2]_se[_cons] 6.5 ------------------------- min 6.5 e(rmse) 11.3 e(rss) 11.3 . end of do-file