47.0 DESCRIBE Command The DESCRIBE command produces series summary measures for all possible non-missing data points and for subsets. This is in contrast to the means produced with the DATA step that include all points. The GROUPMEAN sentence is useful in determining the union of non-missing data. If this option is used, data should be loaded using the KEEPMISS option. For added detail see call describe command under MATRIX command and Stokes (200x) Chapter 2. Of special note is the various formulas used. Form of DESCRIBE command. B34SEXEC DESCRIBE options parameters$ VAR $ BIVARIATE( ) options parameters$ GROUPMEAN( ) options parameters$ B34SEEND$ Options of DESCRIBE sentence. NPRINT Turns off all analysis except what is requested on BIVARIATE and GROUPMEAN sentences. Pamameters on DESCRIBE sentence. IBEGIN=n1 Sets first observation to use. Default = 1. IEND=n2 Sets last observation to use. Default = last observation in dataset. VAR sentence. The var sentence is used to specify the variables to analyse. If this sentence is not present, all variables will be analysed. GROUPMEAN sentence. GROUPMEAN(var1 var2 var3)$ There can be up to 99 GROUPMEAN sentences. The arguments to the GROUPMEAN sentence are variables. Summary measures are provided for a dataset where all variables listed in the groupmean sentence are not missing. GROUPMEAN sentence options. NPRINT - Curtails printing of means etc to save paper. If this option is used, only the total number of observations and number of non missing observatiions will be given. BIVARIATE sentence. This sentence supplies only two series for specific tests. The command BIVARIATE(x y)$ performs analysis on the observations where x and y are both not missing. There can be up to 99 BIVARIATE sentences. Options on the BIVARIATE sentence. ALL - This turns on all tests. PCORR - Calculates the Pearson linear Correlation coefficient. SCORR - Calculates the Spearman rank order correlation coefficient. SVARTTEST - Assumed same variance t test of two means. DVARTTEST - Assumed different variance t test of two means. PAIRTTEST - Paired t test of significance of two means. VARTEST - F test of two variances. KENDALLTAU- Kendall's Tau test. KSTEST - Kolmogorov-Smirnov test of whether two series came from same distribution. Notes: If missing data is in the sample the series passed to each procedure are the observations where both x and y are not missing. The DESCRIBE command loads data in core to speed up execution. For large datasets with limited memory, use the VAR sentence to limit the number of series processed to save space. Example # 1. User wants to obtain summary measures (average, average deviation, standard deviation, variance, skewness, kurtosis, number of missing cases, number of valid cases) on all variables. b34sexec describe$ b34seend$ Example # 2. Same as example # 1 except want to look at x and y only. b34sexec describe$ var x y$ b34seend$ Example # 3A. User wants summary measures for all cases where both (x,y) and (z,q) have non missing values. b34sexec describe$ groupmean(x,y)$ groupmean(z,q)$ b34seend$ Example # 3B. User wants summary measures for all cases where both (x,y) and (z,q) have non missing values and wants to limit output. b34sexec describe noprint$ groupmean(x,y) noprint$ groupmean(z,q) noprint$ b34seend$ Example # 4. User wants to perform bivariate tests on (x,y) and (z,q). Since ALL has been specified, all tests are run. b34sexec describe$ bivariate(x,y) all$ bivariate(z,q) all$ b34seend$ Example # 5. User wants to perform bivariate tests on (x,y) and (z,q) to test if the series came from the same distribution. b34sexec describe$ bivariate(x,y) kstest$ b34seend$ Example # 6. Tests aginst matrix and Rats. /; /; set = 1 if want to validate with Rats /; %b34slet runrats=1; b34sexec options ginclude('gas.b34'); b34srun; b34sexec describe$ b34srun$ /; /; Test with Matrix Command /; b34sexec matrix; call loaddata; call describe(gasin :print); call describe(gasout :print); b34srun; %b34sif(&runrats.ne.0)%then; b34sexec options open('rats.dat') unit(28) disp=unknown$ b34srun$ b34sexec options open('rats.in') unit(29) disp=unknown$ b34srun$ b34sexec options clean(28)$ b34srun$ b34sexec options clean(29)$ b34srun$ b34sexec pgmcall$ rats passasts pcomments('* ', '* Data passed from B34S system to RATS', '* ', "display @1 %dateandtime() @33 ' Rats Version ' %ratsversion()" '* ') $ PGMCARDS$ * stats(moments,print,fractiles) gasin stats(moments,print,fractiles) gasout * b34sreturn$ b34srun $ b34sexec options close(28)$ b34srun$ b34sexec options close(29)$ b34srun$ b34sexec options /$ dodos(' rats386 rats.in rats.out ') dodos('start /w /r rats32s rats.in /run') dounix('rats rats.in rats.out')$ B34SRUN$ b34sexec options npageout WRITEOUT('Output from RATS',' ',' ') COPYFOUT('rats.out') dodos('ERASE rats.in','ERASE rats.out','ERASE rats.dat') dounix('rm rats.in','rm rats.out','rm rats.dat') $ B34SRUN$ %b34sendif;