___  ____  ____  ____  ____ (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 wampler4.do 

. /* NIST/ITL StRD benchmark
> 
> Linear Regression
> 
> Difficulty=Higher  Polynomial  k=6  N=21  Generated
> 
> Dataset Name:  Wampler-4 (wampler4.dat)
> 
> Procedure:     Linear Least Squares Regression
> 
> Reference:     Wampler, R. H. (1970).
>                A Report of the Accuracy of Some Widely-Used Least
>                Squares Computer Programs.
>                Journal of the American Statistical Association, 65, pp. 549-5
> 65.
> 
> Data:          1 Response Variable (y)
>                1 Predictor Variable (x)
>                21 Observations
>                Higher Level of Difficulty
>                Generated Data
> 
> Model:         Polynomial Class
>                6 Parameters (B0,B1,...,B5)
> 
>                y = B0 + B1*x + B2*(x**2) + B3*(x**3)+ B4*(x**4) + B5*(x**5)
> 
> 
>               Certified Regression Statistics
> 
>                                           Standard Deviation
>      Parameter          Estimate             of Estimate
> 
>         B0        1.00000000000000         215232.624678170
>         B1        1.00000000000000         236355.173469681
>         B2        1.00000000000000         77934.3524331583
>         B3        1.00000000000000         10147.5507550350
>         B4        1.00000000000000         564.566512170752
>         B5        1.00000000000000         11.2324854679312
> 
>      Residual
>      Standard Deviation   236014.502379268
> 
>      R-Squared            0.957478440825662
> 
> 
>                Certified Analysis of Variance Table
> 
> Source of Degrees of     Sums of                Mean
> Variation  Freedom       Squares               Squares          F Statistic
> 
> Regression    5      18814317208116.7      3762863441623.33   67.552445824012
> 2
> Residual     15      835542680000.000      55702845333.3333
> */
. 
. clear

. 
. scalar N        = 21

. scalar df_r     = 15

. scalar df_m     = 5

. 
. scalar rmse     = 236014.502379268

. scalar r2       = 0.957478440825662

. scalar mss      = 18814317208116.7

. scalar F        = 67.5524458240122

. scalar rss      = 835542680000.000

. 
. scalar b_cons   = 1

. scalar se_cons  = 215232.624678170

. scalar bx1      = 1

. scalar sex1     = 236355.173469681

. scalar bx2      = 1

. scalar sex2     = 77934.3524331583

. scalar bx3      = 1

. scalar sex3     = 10147.5507550350

. scalar bx4      = 1

. scalar sex4     = 564.566512170752

. scalar bx5      = 1

. scalar sex5     = 11.2324854679312

. 
. qui input long y byte x1

. 
. gen int  x2 = x1*x1

. gen long x3 = x1*x2

. gen long x4 = x1*x3

. gen long x5 = x1*x4

. 
. reg y x1-x5

      Source |       SS           df       MS      Number of obs   =        21
-------------+----------------------------------   F(5, 15)        =     67.55
       Model |  1.8814e+13         5  3.7629e+12   Prob > F        =    0.0000
    Residual |  8.3554e+11        15  5.5703e+10   R-squared       =    0.9575
-------------+----------------------------------   Adj R-squared   =    0.9433
       Total |  1.9650e+13        20  9.8249e+11   Root MSE        =    2.4e+05

------------------------------------------------------------------------------
           y |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
          x1 |   .9999997   236355.2     0.00   1.000    -503778.1    503780.1
          x2 |          1   77934.35     0.00   1.000    -166112.1    166114.1
          x3 |          1   10147.55     0.00   1.000    -21627.99    21629.99
          x4 |          1   564.5665     0.00   0.999    -1202.345    1204.345
          x5 |          1   11.23249     0.09   0.930    -22.94148    24.94148
       _cons |          1   215232.6     0.00   1.000    -458756.5    458758.5
------------------------------------------------------------------------------

. di "R-squared = " %20.15f e(r2)
R-squared =    0.957478440825662

. 
. 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 /*
> */ _b[x3] bx3 _b[x4] bx4 _b[x5] bx5 () /*
> */ _se[_cons] se_cons _se[x1] sex1 _se[x2] sex2 /*
> */ _se[x3] sex3 _se[x4] sex4 _se[x5] sex5 () /*
> */ e(rmse) rmse e(r2) r2 e(mss) mss e(F) F e(rss) rss

_b[_cons]            6.8
_b[x1]               6.5
_b[x2]               6.9
_b[x3]               7.7
_b[x4]               9.0
_b[x5]              10.7
-------------------------
min                  6.5

_se[_cons]          11.4
_se[x1]             10.9
_se[x2]             10.8
_se[x3]             10.8
_se[x4]             10.8
_se[x5]             10.8
-------------------------
min                 10.8

e(rmse)             14.8
e(r2)               15.9
e(mss)              14.7
e(F)                15.2
e(rss)             <exactly equal>

. 
end of do-file