___ ____ ____ ____ ____ (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 lottery.do . /* NIST/ITL StRD > > Univariate Summary Statistics > > Difficulty=Lower N=218 Observed > > File Name: lottery.dat > > Dataset Name: Maryland Pick-3 Lottery > > Description: This is an observed/"real world" data set > consisting of 218 Maryland Pick-3 Lottery values > from September 3, 1989 to April 14, 1990 (32 weeks). > One 3-digit random number (from 000 to 999) > is drawn per day, 7 days per week for most > weeks, but fewer days per week for some weeks. > 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 = 3-digit random number > 0 Predictors > 218 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: 518.958715596330 > Sample Standard Deviation (denom. = n-1) s: 291.699727470969 > Sample Autocorrelation Coefficient (lag 1) r(1): -0.120948622967393 > > Number of Observations: 218 > */ . . clear . . scalar N = 218 . scalar mean = 518.958715596330 . scalar sd = 291.699727470969 . scalar rho1 = -0.120948622967393 . . qui input int y . . summarize y Variable | Obs Mean Std. Dev. Min Max -------------+--------------------------------------------------------- y | 218 518.9587 291.6997 4 999 . assert scalar(N) == r(N) . . lrecomp r(mean) mean sqrt(r(Var)) sd r(mean) 15.2 sqrt(r(Var)) 15.7 . . gen time = _n . tsset time time variable: time, 1 to 218 delta: 1 unit . corrgram y, lag(1) -1 0 1 -1 0 1 LAG AC PAC Q Prob>Q [Autocorrelation] [Partial Autocor] ------------------------------------------------------------------------------- 1 -0.1209 -0.1222 3.2331 0.0722 | | . . lrecomp r(ac1) rho1 r(ac1) 15.0 . end of do-file