___ ____ ____ ____ ____ (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 lew.do . /* NIST StRD benchmark from http://www.nist.gov/itl/div898/strd/ > > Univariate Summary Statistics > > Difficulty=Lower N=200 Observed > > File Name: lew.dat > > Dataset Name: Beam Deflections > > Description: This is an observed/"real world" data set > consisting of 200 deflections of a steel-concrete > beam while subjected to periodic pressure. > The experimenter was H. S. Lew of the > Center for Building Technology at NIST. > We here use this data to test accuracy > in summary statistics calculations. > > Stat Category: Univariate: Summary Statistics > > Reference: None > > Data: "Real World" > 1 Response : y = beam deflection > 0 Predictors > 200 Observations > > Model: Lower Level of Difficulty > 2 Parameters : mu, sigma > 1 Response Variable : y > 0 Predictor Variables > > y = mu + e > > Certified Values > Sample Mean ybar: -177.435000000000 > Sample Standard Deviation (denom. = n-1) s: 277.332168044316 > Sample Autocorrelation Coefficient (lag 1) r(1): -0.307304800605679 > > Number of Observations: 200 > */ . . clear . . scalar N = 200 . scalar mean = -177.435000000000 . scalar sd = 277.332168044316 . scalar rho1 = -0.307304800605679 . . qui input int y . . summarize y Variable | Obs Mean Std. Dev. Min Max -------------+--------------------------------------------------------- y | 200 -177.435 277.3322 -579 300 . assert scalar(N) == r(N) . . lrecomp r(mean) mean sqrt(r(Var)) sd r(mean) sqrt(r(Var)) 15.4 . . gen time = _n . tsset time time variable: time, 1 to 200 delta: 1 unit . corrgram y, lag(1) -1 0 1 -1 0 1 LAG AC PAC Q Prob>Q [Autocorrelation] [Partial Autocor] ------------------------------------------------------------------------------- 1 -0.3073 -0.3088 19.172 0.0000 --| --| . . lrecomp r(ac1) rho1 r(ac1) 14.8 . . end of do-file