___ ____ ____ ____ ____ (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 chwirut2.do . /* NIST/ITL StRD > > Nonlinear Regression > > Difficulty=Lower Exponential k=3 N=54 Observed > > Dataset Name: Chwirut2 (Chwirut2.dat) > > Procedure: Nonlinear Least Squares Regression > > Description: These data are the result of a NIST study involving > ultrasonic calibration. The response variable is > ultrasonic response, and the predictor variable is > metal distance. > > Reference: Chwirut, D., NIST (197?). > Ultrasonic Reference Block Study. > > Data: 1 Response (y = ultrasonic response) > 1 Predictor (x = metal distance) > 54 Observations > Lower Level of Difficulty > Observed Data > > Model: Exponential Class > 3 Parameters (b1 to b3) > > y = exp(-b1*x)/(b2+b3*x) + e > > > Starting values Certified Values > > Start 1 Start 2 Parameter Standard Deviation > b1 = 0.1 0.15 1.6657666537E-01 3.8303286810E-02 > b2 = 0.01 0.008 5.1653291286E-03 6.6621605126E-04 > b3 = 0.02 0.010 1.2150007096E-02 1.5304234767E-03 > > Residual Sum of Squares: 5.1304802941E+02 > Residual Standard Deviation: 3.1717133040E+00 > Degrees of Freedom: 51 > Number of Observations: 54 > */ . . clear . . scalar N = 54 . scalar df_r = 51 . scalar df_m = 3 . . scalar rss = 5.1304802941E+02 . scalar rmse = 3.1717133040E+00 . . scalar b1 = 1.6657666537E-01 . scalar seb1 = 3.8303286810E-02 . scalar b2 = 5.1653291286E-03 . scalar seb2 = 6.6621605126E-04 . scalar b3 = 1.2150007096E-02 . scalar seb3 = 1.5304234767E-03 . . qui input double (y x) . . nl ( y = exp(-{b1}*x) / ({b2} + {b3}*x) ), /// > init(b1 0.1 b2 0.01 b3 0.02) eps(1e-10) (obs = 54) Iteration 0: residual SS = 1127.463 Iteration 1: residual SS = 524.0564 Iteration 2: residual SS = 513.0496 Iteration 3: residual SS = 513.048 Iteration 4: residual SS = 513.048 Iteration 5: residual SS = 513.048 Iteration 6: residual SS = 513.048 Iteration 7: residual SS = 513.048 Iteration 8: residual SS = 513.048 Source | SS df MS -------------+---------------------------------- Number of obs = 54 Model | 89982.547 3 29994.1823 R-squared = 0.9943 Residual | 513.04803 51 10.0597653 Adj R-squared = 0.9940 -------------+---------------------------------- Root MSE = 3.171713 Total | 90495.595 54 1675.84435 Res. dev. = 274.8202 ------------------------------------------------------------------------------ y | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- /b1 | .1665767 .0383033 4.35 0.000 .0896796 .2434737 /b2 | .0051653 .0006662 7.75 0.000 .0038278 .0065028 /b3 | .01215 .0015304 7.94 0.000 .0090776 .0152225 ------------------------------------------------------------------------------ . . 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] 8.3 [b3]_b[_cons] 8.2 ------------------------- min 8.0 [b1]_se[_cons] 6.7 [b2]_se[_cons] 6.3 [b3]_se[_cons] 6.3 ------------------------- min 6.3 e(rmse) 10.9 e(rss) 11.2 . end of do-file