___ ____ ____ ____ ____ (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 norris.do . /* NIST StRD benchmark from http://www.nist.gov/itl/div898/strd/ > > Linear Regression > > Difficulty=Lower Linear k=2 N=36 Observed > > Dataset Name: Norris (norris11.dat) > > Procedure: Linear Least Squares Regression > > Reference: Norris, J., NIST. > Calibration of Ozone Monitors. > > Data: 1 Response Variable (y) > 1 Predictor Variable (x) > 36 Observations > Lower Level of Difficulty > Observed Data > > Model: Linear Class > 2 Parameters (B0,B1) > > y = B0 + B1*x + e > > > Certified Regression Statistics > > Standard Deviation > Parameter Estimate of Estimate > > B0 -0.262323073774029 0.232818234301152 > B1 1.00211681802045 0.429796848199937E-03 > > Residual > Standard Deviation 0.884796396144373 > > R-Squared 0.999993745883712 > > > Certified Analysis of Variance Table > > Source of Degrees of Sums of Mean > Variation Freedom Squares Squares F Statistic > > Regression 1 4255954.13232369 4255954.13232369 5436385.54079785 > Residual 34 26.6173985294224 0.782864662630069 > */ . . clear . . scalar N = 36 . scalar df_r = 34 . scalar df_m = 1 . . scalar rmse = 0.884796396144373 . scalar r2 = 0.999993745883712 . scalar mss = 4255954.13232369 . scalar F = 5436385.54079785 . scalar rss = 26.6173985294224 . . scalar b_cons = -0.262323073774029 . scalar se_cons = 0.232818234301152 . scalar bx = 1.00211681802045 . scalar sex = 0.429796848199937E-03 . . qui input double (y x) . . reg y x Source | SS df MS Number of obs = 36 -------------+---------------------------------- F(1, 34) > 99999.00 Model | 4255954.13 1 4255954.13 Prob > F = 0.0000 Residual | 26.6173985 34 .782864663 R-squared = 1.0000 -------------+---------------------------------- Adj R-squared = 1.0000 Total | 4255980.75 35 121599.45 Root MSE = .8848 ------------------------------------------------------------------------------ y | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- x | 1.002117 .0004298 2331.61 0.000 1.001243 1.00299 _cons | -.2623231 .2328182 -1.13 0.268 -.7354667 .2108205 ------------------------------------------------------------------------------ . di "R-squared = " %20.15f e(r2) R-squared = 0.999993745883712 . . assert N == e(N) . assert df_r == e(df_r) . assert df_m == e(df_m) . . lrecomp _b[_cons] b_cons _b[x] bx () /* > */ _se[_cons] se_cons _se[x] sex () /* > */ e(rmse) rmse e(r2) r2 e(mss) mss e(F) F e(rss) rss _b[_cons] 12.8 _b[x] 14.4 ------------------------- min 12.8 _se[_cons] 13.5 _se[x] 13.5 ------------------------- min 13.5 e(rmse) 13.5 e(r2) 15.5 e(mss) 15.2 e(F) 13.2 e(rss) 13.3 . . end of do-file