___ ____ ____ ____ ____ (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 pontius.do . /* NIST/ITL StRD > > Linear Regression > > Difficulty=Lower Quadratic k=3 N=40 Observed > > Dataset Name: Pontius > > Procedure: Linear Least Squares Regression > > Reference: Pontius, P., NIST. > Load Cell Calibration. > > Data: 1 Response Variable (y) > 1 Predictor Variable (x) > 40 Observations > Lower Level of Difficulty > Observed Data > > Model: Quadratic Class > 3 Parameters (B0,B1,B2) > y = B0 + B1*x + B2*(x**2) > > > Certified Regression Statistics > > Standard Deviation > Parameter Estimate of Estimate > > B0 0.673565789473684E-03 0.107938612033077E-03 > B1 0.732059160401003E-06 0.157817399981659E-09 > B2 -0.316081871345029E-14 0.486652849992036E-16 > > Residual > Standard Deviation 0.205177424076185E-03 > > R-Squared 0.999999900178537 > > > Certified Analysis of Variance Table > > Source of Degrees of Sums of Mean > Variation Freedom Squares Squares F Statistic > > Regression 2 15.6040343244198 7.80201716220991 185330865.995 > 752 > Residual 37 0.155761768796992E-05 0.420977753505385E-07 > */ . . clear . . scalar N = 40 . scalar df_r = 37 . scalar df_m = 2 . . scalar rmse = 0.205177424076185E-03 . scalar r2 = 0.999999900178537 . scalar mss = 15.6040343244198 . scalar F = 185330865.995752 . scalar rss = 0.155761768796992E-05 . . scalar b_cons = 0.673565789473684E-03 . scalar se_cons = 0.107938612033077E-03 . scalar bx1 = 0.732059160401003E-06 . scalar sex1 = 0.157817399981659E-09 . scalar bx2 = -0.316081871345029E-14 . scalar sex2 = 0.486652849992036E-16 . . qui input double (y x1) . . gen double x2 = x1*x1 . . reg y x1 x2 Source | SS df MS Number of obs = 40 -------------+---------------------------------- F(2, 37) > 99999.00 Model | 15.6040343 2 7.80201716 Prob > F = 0.0000 Residual | 1.5576e-06 37 4.2098e-08 R-squared = 1.0000 -------------+---------------------------------- Adj R-squared = 1.0000 Total | 15.6040359 39 .400103484 Root MSE = .00021 ------------------------------------------------------------------------------ y | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- x1 | 7.32e-07 1.58e-10 4638.65 0.000 7.32e-07 7.32e-07 x2 | -3.16e-15 4.87e-17 -64.95 0.000 -3.26e-15 -3.06e-15 _cons | .0006736 .0001079 6.24 0.000 .0004549 .0008923 ------------------------------------------------------------------------------ . di "R-squared = " %20.15f e(r2) R-squared = 0.999999900178537 . . assert N == e(N) . assert df_r == e(df_r) . assert df_m == e(df_m) . . lrecomp _b[_cons] b_cons _b[x1] bx1 _b[x2] bx2 () /* > */ _se[_cons] se_cons _se[x1] sex1 _se[x2] sex2 () /* > */ e(rmse) rmse e(r2) r2 e(mss) mss e(F) F e(rss) rss _b[_cons] 11.5 _b[x1] 14.3 _b[x2] 12.4 ------------------------- min 11.5 _se[_cons] 13.0 _se[x1] 13.0 _se[x2] 13.0 ------------------------- min 13.0 e(rmse) 13.0 e(r2) 16.0 e(mss) 15.0 e(F) 12.7 e(rss) 12.7 . . end of do-file