___ ____ ____ ____ ____ ® /__ / ____/ / ____/ 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 misra1d.do . /* NIST/ITL StRD > Dataset Name: Misra1d (Misra1d.dat) > > File Format: ASCII > Starting Values (lines 41 to 42) > Certified Values (lines 41 to 47) > Data (lines 61 to 74) > > 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 (y = volume) > 1 Predictor (x = pressure) > 14 Observations > Average Level of Difficulty > Observed Data > > Model: Miscellaneous Class > 2 Parameters (b1 and b2) > > y = b1*b2*x*((1+b2*x)**(-1)) + e > > > > Starting values Certified Values > > Start 1 Start 2 Parameter Standard Deviation > b1 = 500 450 4.3736970754E+02 3.6489174345E+00 > b2 = 0.0001 0.0003 3.0227324449E-04 2.9334354479E-06 > > Residual Sum of Squares: 5.6419295283E-02 > Residual Standard Deviation: 6.8568272111E-02 > Degrees of Freedom: 12 > Number of Observations: 14 > */ . . clear . . scalar N = 14 . scalar df_r = 12 . scalar df_m = 2 . . scalar rss = 5.6419295283E-02 . scalar rmse = 6.8568272111E-02 . . scalar b1 = 4.3736970754E+02 . scalar seb1 = 3.6489174345E+00 . scalar b2 = 3.0227324449E-04 . scalar seb2 = 2.9334354479E-06 . . qui input double(y x) . . nl ( y = {b1}*{b2}*x*( (1 + {b2}*x)^(-1) ) ), init(b1 500 b2 0.0001) eps(1e-1 > 0) Iteration 0: Residual SS = 10602.92 Iteration 1: Residual SS = 9606.646 Iteration 2: Residual SS = 460.899 Iteration 3: Residual SS = 14.49105 Iteration 4: Residual SS = .0801687 Iteration 5: Residual SS = .0564193 Iteration 6: Residual SS = .0564193 Iteration 7: Residual SS = .0564193 Iteration 8: Residual SS = .0564193 Source | SS df MS -------------+---------------------------------- Number of obs = 14 Model | 33059.577 2 16529.7883 R-squared = 1.0000 Residual | .0564193 12 .004701608 Adj R-squared = 1.0000 -------------+---------------------------------- Root MSE = .0685683 Total | 33059.633 14 2361.40236 Res. dev. = -37.46574 ------------------------------------------------------------------------------ y | Coefficient Std. err. t P>|t| [95% conf. interval] -------------+---------------------------------------------------------------- /b1 | 437.3697 3.648916 119.86 0.000 429.4194 445.32 /b2 | .0003023 2.93e-06 103.04 0.000 .0002959 .0003087 ------------------------------------------------------------------------------ . . 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.3 ------------------------- min 9.3 [b1]_se[_cons] 6.5 [b2]_se[_cons] 6.5 ------------------------- min 6.5 e(rmse) 11.1 e(rss) 11.2 . . . end of do-file