___ ____ ____ ____ ____ tm /__ / ____/ / ____/ ___/ / /___/ / /___/ 10.0 Copyright 1984-2007 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, PhD 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 enso.do . /* NIST/ITL StRD > Dataset Name: ENSO (ENSO.dat) > > File Format: ASCII > Starting Values (lines 41 to 49) > Certified Values (lines 41 to 54) > Data (lines 61 to 228) > > Procedure: Nonlinear Least Squares Regression > > Description: The data are monthly averaged atmospheric pressure > differences between Easter Island and Darwin, > Australia. This difference drives the trade winds in > the southern hemisphere. Fourier analysis of the data > reveals 3 significant cycles. The annual cycle is the > strongest, but cycles with periods of approximately 44 > and 26 months are also present. These cycles > correspond to the El Nino and the Southern Oscillation. > Arguments to the SIN and COS functions are in radians. > > Reference: Kahaner, D., C. Moler, and S. Nash, (1989). > Numerical Methods and Software. > Englewood Cliffs, NJ: Prentice Hall, pp. 441-445. > > Data: 1 Response (y = atmospheric pressure) > 1 Predictor (x = time) > 168 Observations > Average Level of Difficulty > Observed Data > > Model: Miscellaneous Class > 9 Parameters (b1 to b9) > > y = b1 + b2*cos( 2*pi*x/12 ) + b3*sin( 2*pi*x/12 ) > + b5*cos( 2*pi*x/b4 ) + b6*sin( 2*pi*x/b4 ) > + b8*cos( 2*pi*x/b7 ) + b9*sin( 2*pi*x/b7 ) + e > > Starting values Certified Values > > Start 1 Start 2 Parameter Standard Deviation > b1 = 11.0 10.0 1.0510749193E+01 1.7488832467E-01 > b2 = 3.0 3.0 3.0762128085E+00 2.4310052139E-01 > b3 = 0.5 0.5 5.3280138227E-01 2.4354686618E-01 > b4 = 40.0 44.0 4.4311088700E+01 9.4408025976E-01 > b5 = -0.7 -1.5 -1.6231428586E+00 2.8078369611E-01 > b6 = -1.3 0.5 5.2554493756E-01 4.8073701119E-01 > b7 = 25.0 26.0 2.6887614440E+01 4.1612939130E-01 > b8 = -0.3 -0.1 2.1232288488E-01 5.1460022911E-01 > b9 = 1.4 1.5 1.4966870418E+00 2.5434468893E-01 > > Residual Sum of Squares: 7.8853978668E+02 > Residual Standard Deviation: 2.2269642403E+00 > Degrees of Freedom: 159 > Number of Observations: 168 > */ . . clear . . scalar N = 168 . scalar df_r = 159 . scalar df_m = 8 . . scalar rss = 7.8853978668E+02 . scalar rmse = 2.2269642403E+00 . . scalar b1 = 1.0510749193E+01 . scalar seb1 = 1.7488832467E-01 . scalar b2 = 3.0762128085E+00 . scalar seb2 = 2.4310052139E-01 . scalar b3 = 5.3280138227E-01 . scalar seb3 = 2.4354686618E-01 . scalar b4 = 4.4311088700E+01 . scalar seb4 = 9.4408025976E-01 . scalar b5 = -1.6231428586E+00 . scalar seb5 = 2.8078369611E-01 . scalar b6 = 5.2554493756E-01 . scalar seb6 = 4.8073701119E-01 . scalar b7 = 2.6887614440E+01 . scalar seb7 = 4.1612939130E-01 . scalar b8 = 2.1232288488E-01 . scalar seb8 = 5.1460022911E-01 . scalar b9 = 1.4966870418E+00 . scalar seb9 = 2.5434468893E-01 . . qui input double(y x) . . #delimit ; delimiter now ; . nl (y = {b1} + {b2}*cos( 2*_pi*x/12 ) + {b3}*sin( 2*_pi*x/12 ) > + {b5}*cos( 2*_pi*x/{b4} ) + {b6}*sin( 2*_pi*x/{b4} ) > + {b8}*cos( 2*_pi*x/{b7} ) + {b9}*sin( 2*_pi*x/{b7} ) ), > initial(b1 11.0 > b2 3.0 > b3 0.5 > b4 40.0 > b5 -0.7 > b6 -1.3 > b7 25.0 > b8 -0.3 > b9 1.4) > hasconstant(b1) > eps(1e-10) ; (obs = 168) Iteration 0: residual SS = 998.5415 Iteration 1: residual SS = 971.5678 Iteration 2: residual SS = 897.1252 Iteration 3: residual SS = 819.5468 Iteration 4: residual SS = 814.0083 Iteration 5: residual SS = 792.1716 Iteration 6: residual SS = 790.4707 Iteration 7: residual SS = 789.0062 Iteration 8: residual SS = 788.7323 Iteration 9: residual SS = 788.6135 Iteration 10: residual SS = 788.5708 Iteration 11: residual SS = 788.5524 Iteration 12: residual SS = 788.5451 Iteration 13: residual SS = 788.5419 Iteration 14: residual SS = 788.5407 Iteration 15: residual SS = 788.5402 Iteration 16: residual SS = 788.5399 Iteration 17: residual SS = 788.5399 Iteration 18: residual SS = 788.5398 Iteration 19: residual SS = 788.5398 Iteration 20: residual SS = 788.5398 Iteration 21: residual SS = 788.5398 Iteration 22: residual SS = 788.5398 Iteration 23: residual SS = 788.5398 Iteration 24: residual SS = 788.5398 Iteration 25: residual SS = 788.5398 Iteration 26: residual SS = 788.5398 Iteration 27: residual SS = 788.5398 Iteration 28: residual SS = 788.5398 Iteration 29: residual SS = 788.5398 Source | SS df MS -------------+------------------------------ Number of obs = 168 Model | 1174.48855 8 146.811068 R-squared = 0.5983 Residual | 788.539787 159 4.95936973 Adj R-squared = 0.5781 -------------+------------------------------ Root MSE = 2.226964 Total | 1963.02833 167 11.7546607 Res. dev. = 736.5281 ------------------------------------------------------------------------------ y | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- /b1 | 10.51075 .1748883 60.10 0.000 10.16535 10.85615 /b2 | 3.076213 .2431005 12.65 0.000 2.59609 3.556335 /b3 | .5328015 .2435469 2.19 0.030 .0517973 1.013806 /b5 | -1.623145 .2807823 -5.78 0.000 -2.177689 -1.068601 /b4 | 44.31108 .9440805 46.94 0.000 42.44652 46.17563 /b6 | .5255377 .4807381 1.09 0.276 -.4239182 1.474994 /b8 | .2123182 .5146004 0.41 0.680 -.8040158 1.228652 /b7 | 26.88761 .4161292 64.61 0.000 26.06576 27.70946 /b9 | 1.496688 .2543436 5.88 0.000 .9943602 1.999016 ------------------------------------------------------------------------------ Parameter b1 taken as constant term in model & ANOVA table . #delimit cr delimiter now cr . 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 [b3]_b[_cons] b3 /* > */ [b4]_b[_cons] b4 [b5]_b[_cons] b5 [b6]_b[_cons] b6 [b7]_b[_cons] b7 /* > */ [b8]_b[_cons] b8 [b9]_b[_cons] b9 () /* > */ [b1]_se[_cons] seb1 [b2]_se[_cons] seb2 [b3]_se[_cons] seb3 /* > */ [b4]_se[_cons] seb4 [b5]_se[_cons] seb5 [b6]_se[_cons] seb6 [b7]_se[_cons] > seb7 /* > */ [b8]_se[_cons] seb8 [b9]_se[_cons] seb9 () /* > */ e(rmse) rmse e(rss) rss [b1]_b[_cons] 7.5 [b2]_b[_cons] 8.0 [b3]_b[_cons] 6.7 [b4]_b[_cons] 6.5 [b5]_b[_cons] 5.9 [b6]_b[_cons] 4.9 [b7]_b[_cons] 6.9 [b8]_b[_cons] 4.7 [b9]_b[_cons] 6.3 ------------------------- min 4.7 [b1]_se[_cons] 7.5 [b2]_se[_cons] 8.3 [b3]_se[_cons] 7.7 [b4]_se[_cons] 6.6 [b5]_se[_cons] 5.3 [b6]_se[_cons] 5.7 [b7]_se[_cons] 6.2 [b8]_se[_cons] 6.4 [b9]_se[_cons] 5.4 ------------------------- min 5.3 e(rmse) 12.5 e(rss) 11.3 . . end of do-file