___ ____ ____ ____ ____ © /__ / ____/ / ____/ 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 misra1a.do . /* NIST/ITL StRD > > Nonlinear Regression > > Difficulty=Lower Exponential k=2 N=14 Observed > > Dataset Name: Misra1a (Misra1a.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 Variable (y = volume) > 1 Predictor Variable (x = pressure) > 14 Observations > Lower Level of Difficulty > Observed Data > > Model: Exponential Class > 2 Parameters (b1 and b2) > > y = b1*(1-exp[-b2*x]) + e > > > Starting values Certified Values > > Start 1 Start 2 Parameter Standard Deviation > b1 = 500 250 2.3894212918E+02 2.7070075241E+00 > b2 = 0.0001 0.0005 5.5015643181E-04 7.2668688436E-06 > > Residual Sum of Squares: 1.2455138894E-01 > Residual Standard Deviation: 1.0187876330E-01 > Degrees of Freedom: 12 > Number of Observations: 14 > */ . . clear . . scalar N = 14 . scalar df_r = 12 . scalar df_m = 2 . . scalar rss = 1.2455138894E-01 . scalar rmse = 1.0187876330E-01 . . scalar b1 = 2.3894212918E+02 . scalar seb1 = 2.7070075241E+00 . scalar b2 = 5.5015643181E-04 . scalar seb2 = 7.2668688436E-06 . . qui input double (y x) . . nl ( y = {b1}*(1-exp(-{b2}*x)) ), init(b1 500 b2 0.0001) eps(1e-10) (obs = 14) Iteration 0: residual SS = 10697.62 Iteration 1: residual SS = 10640.08 Iteration 2: residual SS = 10497.53 Iteration 3: residual SS = 10374.65 Iteration 4: residual SS = 10230.61 Iteration 5: residual SS = 9280.129 Iteration 6: residual SS = 2951.824 Iteration 7: residual SS = 2188.115 Iteration 8: residual SS = .7215063 Iteration 9: residual SS = .6258301 Iteration 10: residual SS = .1245514 Iteration 11: residual SS = .1245514 Iteration 12: residual SS = .1245514 Iteration 13: residual SS = .1245514 Source | SS df MS -------------+---------------------------------- Number of obs = 14 Model | 33059.509 2 16529.7543 R-squared = 1.0000 Residual | .12455139 12 .010379282 Adj R-squared = 1.0000 -------------+---------------------------------- Root MSE = .1018788 Total | 33059.633 14 2361.40236 Res. dev. = -26.37904 ------------------------------------------------------------------------------ y | Coefficient Std. err. t P>|t| [95% conf. interval] -------------+---------------------------------------------------------------- /b1 | 238.9421 2.707006 88.27 0.000 233.0441 244.8402 /b2 | .0005502 7.27e-06 75.71 0.000 .0005343 .000566 ------------------------------------------------------------------------------ . . 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] 9.4 [b2]_b[_cons] 9.4 ------------------------- min 9.4 [b1]_se[_cons] 6.4 [b2]_se[_cons] 6.5 ------------------------- min 6.4 e(rmse) 10.6 e(rss) 10.5 . end of do-file