___ ____ ____ ____ ____ (R) /__ / ____/ / ____/ ___/ / /___/ / /___/ 14.0 Copyright 1985-2015 StataCorp LP 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 LP 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. . do dwood.do . /* NIST StRD benchmark from http://www.nist.gov/itl/div898/strd/ > > Nonlinear Regression > > Difficulty=Lower Miscellaneous k=2 N=6 Observed > > Dataset Name: DanielWood (DanielWood.dat) > > Procedure: Nonlinear Least Squares Regression > > Description: These data and model are described in Daniel and Wood > (1980), and originally published in E.S.Keeping, > "Introduction to Statistical Inference," Van Nostrand > Company, Princeton, NJ, 1962, p. 354. The response > variable is energy radieted from a carbon filament > lamp per cm**2 per second, and the predictor variable > is the absolute temperature of the filament in 1000 > degrees Kelvin. > > Reference: Daniel, C. and F. S. Wood (1980). > Fitting Equations to Data, Second Edition. > New York, NY: John Wiley and Sons, pp. 428-431. > > > Data: 1 Response Variable (y = energy) > 1 Predictor Variable (x = temperature) > 6 Observations > Lower Level of Difficulty > Observed Data > > Model: Miscellaneous Class > 2 Parameters (b1 and b2) > > y = b1*x**b2 + e > > > > Starting values Certified Values > > Start 1 Start 2 Parameter Standard Deviation > b1 = 1 0.7 7.6886226176E-01 1.8281973860E-02 > b2 = 5 4 3.8604055871E+00 5.1726610913E-02 > > Residual Sum of Squares: 4.3173084083E-03 > Residual Standard Deviation: 3.2853114039E-02 > Degrees of Freedom: 4 > Number of Observations: 6 > */ . . clear . . scalar N = 6 . scalar df_r = 4 . scalar df_m = 2 . . scalar rss = 4.3173084083E-03 . scalar rmse = 3.2853114039E-02 . . scalar b1 = 7.6886226176E-01 . scalar seb1 = 1.8281973860E-02 . scalar b2 = 3.8604055871E+00 . scalar seb2 = 5.1726610913E-02 . . qui input double (y x) . . nl ( y = {b1}*x^{b2} ), init(b1 1 b2 5) eps(1e-10) (obs = 6) Iteration 0: residual SS = 4.610882 Iteration 1: residual SS = .0316845 Iteration 2: residual SS = .0043206 Iteration 3: residual SS = .0043173 Iteration 4: residual SS = .0043173 Iteration 5: residual SS = .0043173 Iteration 6: residual SS = .0043173 Iteration 7: residual SS = .0043173 Iteration 8: residual SS = .0043173 Source | SS df MS -------------+---------------------------------- Number of obs = 6 Model | 103.9135 2 51.9567503 R-squared = 1.0000 Residual | .00431731 4 .001079327 Adj R-squared = 0.9999 -------------+---------------------------------- Root MSE = .0328531 Total | 103.91782 6 17.3196363 Res. dev. = -26.39403 ------------------------------------------------------------------------------ y | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- /b1 | .7688623 .018282 42.06 0.000 .7181034 .8196211 /b2 | 3.860406 .0517266 74.63 0.000 3.71679 4.004022 ------------------------------------------------------------------------------ . . 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] 8.6 [b2]_b[_cons] 8.8 ------------------------- min 8.6 [b1]_se[_cons] 6.5 [b2]_se[_cons] 6.2 ------------------------- min 6.2 e(rmse) 11.2 e(rss) 11.7 . end of do-file