___ ____ ____ ____ ____ ® /__ / ____/ / ____/ 18.0 ___/ / /___/ / /___/ SE—Standard Edition Statistics and Data Science Copyright 1985-2023 StataCorp LLC StataCorp 4905 Lakeway Drive College Station, Texas 77845 USA 800-STATA-PC https://www.stata.com 979-696-4600 stata@stata.com Stata license: 10-user network perpetual 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 5,000 but can be increased; see help set_maxvar. Running /home/krg/bin/profile.do ... Compile number 180110 . do chwirut1.do . /* NIST/ITL StRD > > Nonlinear Regression > > Difficulty=Lower Exponential k=3 N=214 Observed > > Dataset Name: Chwirut1 (Chwirut1.dat) > > File Format: ASCII > Starting Values (lines 41 to 43) > Certified Values (lines 41 to 48) > Data (lines 61 to 274) > > 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 Variable (y = ultrasonic response) > 1 Predictor Variable (x = metal distance) > 214 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.9027818370E-01 2.1938557035E-02 > b2 = 0.01 0.008 6.1314004477E-03 3.4500025051E-04 > b3 = 0.02 0.010 1.0530908399E-02 7.9281847748E-04 > > Residual Sum of Squares: 2.3844771393E+03 > Residual Standard Deviation: 3.3616721320E+00 > Degrees of Freedom: 211 > Number of Observations: 214 > */ . . clear . . scalar N = 214 . scalar df_r = 211 . scalar df_m = 3 . . scalar rss = 2.3844771393E+03 . scalar rmse = 3.3616721320E+00 . . scalar b1 = 1.9027818370E-01 . scalar seb1 = 2.1938557035E-02 . scalar b2 = 6.1314004477E-03 . scalar seb2 = 3.4500025051E-04 . scalar b3 = 1.0530908399E-02 . scalar seb3 = 7.9281847748E-04 . . qui input double (y x) . . nl ( y = exp(-{b1}*x)/({b2}+{b3}*x) ), init(b1 1 b2 .01 b3 .02) eps(1e-10) Iteration 0: Residual SS = 103077.7 Iteration 1: Residual SS = 38669.29 Iteration 2: Residual SS = 5678.076 Iteration 3: Residual SS = 2453.61 Iteration 4: Residual SS = 2384.491 Iteration 5: Residual SS = 2384.477 Iteration 6: Residual SS = 2384.477 Iteration 7: Residual SS = 2384.477 Iteration 8: Residual SS = 2384.477 Iteration 9: Residual SS = 2384.477 Iteration 10: Residual SS = 2384.477 Source | SS df MS -------------+---------------------------------- Number of obs = 214 Model | 313023.8 3 104341.265 R-squared = 0.9924 Residual | 2384.4771 211 11.3008395 Adj R-squared = 0.9923 -------------+---------------------------------- Root MSE = 3.361672 Total | 315408.27 214 1473.87043 Res. dev. = 1123.208 ------------------------------------------------------------------------------ y | Coefficient Std. err. t P>|t| [95% conf. interval] -------------+---------------------------------------------------------------- /b1 | .1902782 .0219386 8.67 0.000 .1470313 .233525 /b2 | .0061314 .000345 17.77 0.000 .0054513 .0068115 /b3 | .0105309 .0007928 13.28 0.000 .008968 .0120938 ------------------------------------------------------------------------------ . . 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] 7.6 [b2]_b[_cons] 8.0 [b3]_b[_cons] 7.8 ------------------------- min 7.6 [b1]_se[_cons] 6.6 [b2]_se[_cons] 6.3 [b3]_se[_cons] 6.3 ------------------------- min 6.3 e(rmse) 10.9 e(rss) 11.4 . end of do-file