___ ____ ____ ____ ____ (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 numacc1.do . /* NIST/ITL StRD > > Univariate Summary Statistics > > Difficulty=Lower N=3 Generated > > File Name: numacc1.dat > > Dataset Name: Numerical-Accuracy-1 > > Description: This is a constructed/fabricated data set > to test accuracy in summary statistic calculations. > The numbers are large (8-digit integers) and > differ only in the last decimal place. > Note--by construction, this data set has > sample mean = 10000002 (exact) > sample standard deviation = 1 (exact) > sample autocorrelation coef. = -0.5 (exact) > > Stat Category: Univariate: Summary Statistics > > Reference: Simon, Stephen D. and Lesage, James P. (1989). > Assessing the Accuracy of ANOVA Caluclations > in Statistical Software", Computational > Statistics & data Analysis, 8, pp. 325-332. > > Data: Constructed > 1 Response : y > 0 Predictors > 3 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: 10000002 (exact) > Sample Standard Deviation (denom. = n-1) s: 1 (exact) > Sample Autocorrelation Coefficient (lag 1) r(1): -0.5 (exact) > > Number of Observations: 3 > */ . . clear . . scalar N = 3 . scalar mean = 10000002 . scalar sd = 1 . scalar rho1 = -0.5 . . qui input long y . . summarize y Variable | Obs Mean Std. Dev. Min Max -------------+--------------------------------------------------------- y | 3 1.00e+07 1 1.00e+07 1.00e+07 . assert scalar(N) == r(N) . . lrecomp r(mean) mean sqrt(r(Var)) sd r(mean) sqrt(r(Var)) . . gen time = _n . tsset time time variable: time, 1 to 3 delta: 1 unit . corrgram y, lag(1) -1 0 1 -1 0 1 LAG AC PAC Q Prob>Q [Autocorrelation] [Partial Autocor] ------------------------------------------------------------------------------- 1 -0.5000 . 1.875 0.1709 ----| . . lrecomp r(ac1) rho1 r(ac1) . end of do-file