___ ____ ____ ____ ____ tm /__ / ____/ / ____/ ___/ / /___/ / /___/ 9.0 Copyright 1984-2005 Statistics/Data Analysis StataCorp 4905 Lakeway Drive College Station, Texas 77845 USA 800-STATA-PC http://www.stata.com 979-696-4600 stata@stata.com 979-696-4601 (fax) 3-user Stata for Linux64 (network) perpetual license: Serial number: 999 Licensed to: Brian P. Poi, Ph.D. StataCorp LP Notes: 1. (-m# option or -set memory-) 1.00 MB allocated to data 2. Command line editing disabled 3. Stata running in batch mode running /home/bpp/bin/profile.do ... . do hahn1.do . /* NIST StRD benchmark from http://www.nist.gov/itl/div898/strd/ > > Nonlinear Regression > > Difficulty=Average Rational k=7 N=236 Observed > > Dataset Name: Hahn1 (Hahn1.dat) > > Procedure: Nonlinear Least Squares Regression > > Description: These data are the result of a NIST study involving > the thermal expansion of copper. The response > variable is the coefficient of thermal expansion, and > the predictor variable is temperature in degrees > kelvin. > > > Reference: Hahn, T., NIST (197?). > Copper Thermal Expansion Study. > > Data: 1 Response (y = coefficient of thermal expansion) > 1 Predictor (x = temperature, degrees kelvin) > 236 Observations > Average Level of Difficulty > Observed Data > > Model: Rational Class (cubic/cubic) > 7 Parameters (b1 to b7) > > y = (b1+b2*x+b3*x**2+b4*x**3) / > (1+b5*x+b6*x**2+b7*x**3) + e > > > Starting values Certified Values > > Start 1 Start 2 Parameter Standard Deviation > b1 = 10 1 1.0776351733E+00 1.7070154742E-01 > b2 = -1 -0.1 -1.2269296921E-01 1.2000289189E-02 > b3 = 0.05 0.005 4.0863750610E-03 2.2508314937E-04 > b4 = -0.00001 -0.000001 -1.4262662514E-06 2.7578037666E-07 > b5 = -0.05 -0.005 -5.7609940901E-03 2.4712888219E-04 > b6 = 0.001 0.0001 2.4053735503E-04 1.0449373768E-05 > b7 = -0.000001 -0.0000001 -1.2314450199E-07 1.3027335327E-08 > > Residual Sum of Squares: 1.5324382854E+00 > Residual Standard Deviation: 8.1803852243E-02 > Degrees of Freedom: 229 > Number of Observations: 236 > */ . . clear . . scalar N = 236 . scalar df_r = 229 . scalar df_m = 7 . . scalar rss = 1.5324382854E+00 . scalar rmse = 8.1803852243E-02 . . scalar b1 = 1.0776351733E+00 . scalar seb1 = 1.7070154742E-01 . scalar b2 = -1.2269296921E-01 . scalar seb2 = 1.2000289189E-02 . scalar b3 = 4.0863750610E-03 . scalar seb3 = 2.2508314937E-04 . scalar b4 = -1.4262662514E-06 . scalar seb4 = 2.7578037666E-07 . scalar b5 = -5.7609940901E-03 . scalar seb5 = 2.4712888219E-04 . scalar b6 = 2.4053735503E-04 . scalar seb6 = 1.0449373768E-05 . scalar b7 = -1.2314450199E-07 . scalar seb7 = 1.3027335327E-08 . . qui input double (y x) . . #delimit ; delimiter now ; . nl (y = ({b1} + {b2}*x + {b3}*x^2 + {b4}*x^3) / > (1 + {b5}*x + {b6}*x^2 + {b7}*x^3) ) , > initial(b1 10 b2 -1 b3 0.05 b4 -0.00001 b5 -0.05 b6 0.001 b7 -0.000001) > eps(1e-10) ; (obs = 236) Iteration 0: residual SS = 3097557 Iteration 1: residual SS = 82100.05 Iteration 2: residual SS = 8813.617 Iteration 3: residual SS = 1142.476 Iteration 4: residual SS = 25.20977 Iteration 5: residual SS = 10.48817 Iteration 6: residual SS = 1.903717 Iteration 7: residual SS = 1.534958 Iteration 8: residual SS = 1.532439 Iteration 9: residual SS = 1.532438 Iteration 10: residual SS = 1.532438 Iteration 11: residual SS = 1.532438 Iteration 12: residual SS = 1.532438 Source | SS df MS Number of obs = 236 -------------+------------------------------ F( 7, 229) = 1.18e+06 Model | 55508.3561 7 7929.76516 Prob > F = 0.0000 Residual | 1.53243829 229 .00669187 R-squared = 1.0000 -------------+------------------------------ Adj R-squared = 1.0000 Total | 55509.8885 236 235.211392 Root MSE = .0818039 Res. dev. = -518.9863 ------------------------------------------------------------------------------ y | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- b1 | 1.077635 .1707016 6.31 0.000 .7412886 1.413982 b2 | -.122693 .0120003 -10.22 0.000 -.1463381 -.0990479 b3 | .0040864 .0002251 18.15 0.000 .0036429 .0045299 b4 | -1.43e-06 2.76e-07 -5.17 0.000 -1.97e-06 -8.83e-07 b5 | -.005761 .0002471 -23.31 0.000 -.0062479 -.0052741 b6 | .0002405 .0000104 23.02 0.000 .0002199 .0002611 b7 | -1.23e-07 1.30e-08 -9.45 0.000 -1.49e-07 -9.75e-08 ------------------------------------------------------------------------------ (SEs, P values, CIs, and correlations are asymptotic approximations) . #delimit cr delimiter now cr . . assert N == e(N) . assert df_r == e(df_r) . assert df_m == e(df_m) . . lrecomp _b[b1] b1 _b[b2] b2 _b[b3] b3 /* > */ _b[b4] b4 _b[b5] b5 _b[b6] b6 _b[b7] b7 () /* > */ _se[b1] seb1 _se[b2] seb2 _se[b3] seb3 /* > */ _se[b4] seb4 _se[b5] seb5 _se[b6] seb6 _se[b7] seb7 () /* > */ e(rmse) rmse e(rss) rss _b[b1] 7.4 _b[b2] 7.5 _b[b3] 7.8 _b[b4] 7.1 _b[b5] 8.2 _b[b6] 7.9 _b[b7] 7.4 ------------------------- min 7.1 _se[b1] 6.4 _se[b2] 6.3 _se[b3] 6.1 _se[b4] 5.2 _se[b5] 6.6 _se[b6] 5.9 _se[b7] 5.1 ------------------------- min 5.1 e(rmse) 11.5 e(rss) 10.6 . end of do-file