___ ____ ____ ____ ____ (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 eckerle4.do . /* NIST/ITL StRD > Dataset Name: Eckerle4 (Eckerle4.dat) > > File Format: ASCII > Starting Values (lines 41 to 43) > Certified Values (lines 41 to 48) > Data (lines 61 to 95) > > Procedure: Nonlinear Least Squares Regression > > Description: These data are the result of a NIST study involving > circular interference transmittance. The response > variable is transmittance, and the predictor variable > is wavelength. > > > Reference: Eckerle, K., NIST (197?). > Circular Interference Transmittance Study. > > > > > > > Data: 1 Response Variable (y = transmittance) > 1 Predictor Variable (x = wavelength) > 35 Observations > Higher Level of Difficulty > Observed Data > > Model: Exponential Class > 3 Parameters (b1 to b3) > > y = (b1/b2) * exp[-0.5*((x-b3)/b2)**2] + e > > > > Starting values Certified Values > > Start 1 Start 2 Parameter Standard Deviation > b1 = 1 1.5 1.5543827178E+00 1.5408051163E-02 > b2 = 10 5 4.0888321754E+00 4.6803020753E-02 > b3 = 500 450 4.5154121844E+02 4.6800518816E-02 > > Residual Sum of Squares: 1.4635887487E-03 > Residual Standard Deviation: 6.7629245447E-03 > Degrees of Freedom: 32 > Number of Observations: 35 > */ . . clear . . scalar N = 35 . scalar df_r = 32 . scalar df_m = 3 . . scalar rss = 1.4635887487E-03 . scalar rmse = 6.7629245447E-03 . . scalar b1 = 1.5543827178E+00 . scalar seb1 = 1.5408051163E-02 . scalar b2 = 4.0888321754E+00 . scalar seb2 = 4.6803020753E-02 . scalar b3 = 4.5154121844E+02 . scalar seb3 = 4.6800518816E-02 . . qui input double(y x) . . /* The following starting values led to convergence problems: > > nl ( y = ({b1}/{b2}) * exp(-0.5*((x-{b3})/{b2})^2) ), /// > init(b1 1 b2 10 b3 500) eps(1e-10) > > */ . . nl ( y = ({b1}/{b2}) * exp(-0.5*((x-{b3})/{b2})^2) ), /// > init(b1 1.5 b2 5 b3 450) eps(1e-10) (obs = 35) Iteration 0: residual SS = .0072256 Iteration 1: residual SS = .0015258 Iteration 2: residual SS = .0014637 Iteration 3: residual SS = .0014636 Iteration 4: residual SS = .0014636 Iteration 5: residual SS = .0014636 Iteration 6: residual SS = .0014636 Iteration 7: residual SS = .0014636 Iteration 8: residual SS = .0014636 Iteration 9: residual SS = .0014636 Source | SS df MS -------------+---------------------------------- Number of obs = 35 Model | .69823267 3 .232744222 R-squared = 0.9979 Residual | .00146359 32 .000045737 Adj R-squared = 0.9977 -------------+---------------------------------- Root MSE = .0067629 Total | .69969625 35 .019991322 Res. dev. = -253.5517 ------------------------------------------------------------------------------ y | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- /b1 | 1.554383 .0154081 100.88 0.000 1.522998 1.585768 /b2 | 4.088832 .046803 87.36 0.000 3.993498 4.184167 /b3 | 451.5412 .0468005 9648.21 0.000 451.4459 451.6365 ------------------------------------------------------------------------------ . . 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.6 [b2]_b[_cons] 8.3 [b3]_b[_cons] 11.0 ------------------------- min 8.3 [b1]_se[_cons] 7.0 [b2]_se[_cons] 6.4 [b3]_se[_cons] 8.2 ------------------------- min 6.4 e(rmse) 11.3 e(rss) 10.7 . . end of do-file