___ ____ ____ ____ ____ © /__ / ____/ / ____/ 17.0 ___/ / /___/ / /___/ SE—Standard Edition Statistics and Data Science Copyright 1985-2021 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; see help set_maxvar. Running /home/krg/bin/profile.do ... Compile number 170082 . do kirby2.do . /* NIST/ITL StRD > > Nonlinear Regression > > Difficulty=Average Rational k=5 N=151 Observed > > Dataset Name: Kirby2 (Kirby2.dat) > > Procedure: Nonlinear Least Squares Regression > > Description: These data are the result of a NIST study involving > scanning electron microscope line with standards. > > > Reference: Kirby, R., NIST (197?). > Scanning electron microscope line width standards. > > Data: 1 Response (y) > 1 Predictor (x) > 151 Observations > Average Level of Difficulty > Observed Data > > Model: Rational Class (quadratic/quadratic) > 5 Parameters (b1 to b5) > > y = (b1 + b2*x + b3*x**2) / > (1 + b4*x + b5*x**2) + e > > > Starting values Certified Values > > Start 1 Start 2 Parameter Standard Deviation > b1 = 2 1.5 1.6745063063E+00 8.7989634338E-02 > b2 = -0.1 -0.15 -1.3927397867E-01 4.1182041386E-03 > b3 = 0.003 0.0025 2.5961181191E-03 4.1856520458E-05 > b4 = -0.001 -0.0015 -1.7241811870E-03 5.8931897355E-05 > b5 = 0.00001 0.00002 2.1664802578E-05 2.0129761919E-07 > > Residual Sum of Squares: 3.9050739624E+00 > Residual Standard Deviation: 1.6354535131E-01 > Degrees of Freedom: 146 > Number of Observations: 151 > */ . . clear . . scalar N = 151 . scalar df_r = 146 . scalar df_m = 5 . . scalar rss = 3.9050739624E+00 . scalar rmse = 1.6354535131E-01 . . scalar b1 = 1.6745063063E+00 . scalar seb1 = 8.7989634338E-02 . scalar b2 = -1.3927397867E-01 . scalar seb2 = 4.1182041386E-03 . scalar b3 = 2.5961181191E-03 . scalar seb3 = 4.1856520458E-05 . scalar b4 = -1.7241811870E-03 . scalar seb4 = 5.8931897355E-05 . scalar b5 = 2.1664802578E-05 . scalar seb5 = 2.0129761919E-07 . . qui input double (y x) . . nl ( y = ({b1} + {b2}*x + {b3}*x^2) / (1 + {b4}*x + {b5}*x^2) ), /// > init(b1 2 b2 -0.1 b3 0.003 b4 -0.001 b5 0.00001) eps(1e-10) (obs = 151) Iteration 0: residual SS = 31570.49 Iteration 1: residual SS = 640.0434 Iteration 2: residual SS = 7.214178 Iteration 3: residual SS = 3.90511 Iteration 4: residual SS = 3.905074 Iteration 5: residual SS = 3.905074 Iteration 6: residual SS = 3.905074 Iteration 7: residual SS = 3.905074 Iteration 8: residual SS = 3.905074 Iteration 9: residual SS = 3.905074 Iteration 10: residual SS = 3.905074 Source | SS df MS -------------+---------------------------------- Number of obs = 151 Model | 490245.12 5 98049.0238 R-squared = 1.0000 Residual | 3.905074 146 .026747082 Adj R-squared = 1.0000 -------------+---------------------------------- Root MSE = .1635454 Total | 490249.02 151 3246.68228 Res. dev. = -123.386 ------------------------------------------------------------------------------ y | Coefficient Std. err. t P>|t| [95% conf. interval] -------------+---------------------------------------------------------------- /b1 | 1.674506 .0879896 19.03 0.000 1.500608 1.848404 /b2 | -.139274 .0041182 -33.82 0.000 -.147413 -.131135 /b3 | .0025961 .0000419 62.02 0.000 .0025134 .0026788 /b4 | -.0017242 .0000589 -29.26 0.000 -.0018407 -.0016077 /b5 | .0000217 2.01e-07 107.63 0.000 .0000213 .0000221 ------------------------------------------------------------------------------ . . 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 /* > */ [b4]_b[_cons] b4 [b5]_b[_cons] b5 () /* > */ [b1]_se[_cons] seb1 [b2]_se[_cons] seb2 [b3]_se[_cons] seb3 /* > */ [b4]_se[_cons] seb4 [b5]_se[_cons] seb5 () /* > */ e(rmse) rmse e(rss) rss [b1]_b[_cons] 8.0 [b2]_b[_cons] 8.2 [b3]_b[_cons] 8.4 [b4]_b[_cons] 8.2 [b5]_b[_cons] 8.6 ------------------------- min 8.0 [b1]_se[_cons] 8.1 [b2]_se[_cons] 7.9 [b3]_se[_cons] 7.9 [b4]_se[_cons] 7.8 [b5]_se[_cons] 6.3 ------------------------- min 6.3 e(rmse) 10.8 e(rss) 11.6 . end of do-file