OPTIONS pagesize=50 linesize=64; DATA raindata; INPUT rainfall; CARDS; 7 7.2 7.8 7.8 11.5 13 14 14.6 15 15.2 16.2 17.2 17.4 20.7 22.9 24.7 25.9 29.1 30.2 30.2 30.6 30.8 31 31.4 31.7 32.5 33.4 34.4 35 35.1 35.9 35.9 36.1 36.2 36.2 37 37 37.6 38.7 38.8 38.9 39 39.9 40.2 40.2 40.8 40.8 41.8 42.5 42.5 42.6 42.7 42.8 43.1 43.4 44.7 45.5 46 46.4 48.2 48.3 48.5 49.1 49.2 54.5 54.7 56.8 59.2 59.8 67 ; /* The following procedure produces several summary statistics and graphs */ /* DATA= tells SAS which data set to use */ /* VAR tells SAS which variable to compute the statistics and graphs for */ /* If there are several variables in the data set */ /* you could specify more than one variable with VAR */ PROC UNIVARIATE DATA=raindata PLOT FREQ TRIM=0.10 0.20; VAR rainfall; TITLE 'Summary of the Rainfall Data for the 70 Cities'; RUN; /* PROC UNIVARIATE gives summary statistics about the variable "mileage" */ /* Look for the mean, median, variance, standard deviation, etc. */ /* The PLOT FREQ command produces a stem-and-leaf display and boxplot */ /* Notice the UNIVARIATE procedure produces rather rudimentary graphs */ /* The TRIM= option gives (in this case) the 10% trimmed mean and the 20% trimmed mean. */ /* The INSIGHT procedure will give us the same thing as UNIVARIATE */ /* but with more and nicer-looking graphs. */ /* The syntax is slightly different in INSIGHT: */ PROC INSIGHT; OPEN raindata; DIST rainfall; RUN; /* The graphs INSIGHT produces are a box plot and a histogram.*/ /* To change the class intervals, */ /* click on the arrow at the bottom left of the histogram. Choose "Ticks". */ /* First Tick is the start of the first interval, */ /* Last Tick is the end of the last interval, */ /* and Tick Increment is the interval width. */ /* Note how changing the class intervals changes the look of the histogram. */ /* Note that the histogram shown is a relative frequency histogram. */ /* To get a frequency histogram, while still in PROC INSIGHT, */ /* choose the "Analyze" menu, and choose "Histogram/Bar Chart". */ /* Click on the name of the variable (here, MILEAGE) and then click "Y". */ /* Click "OK" and a frequency histogram should appear. */ /* To get a trimmed mean from PROC INSIGHT, choose the "Tables" menu, and then */ /* choose "Trimmed/Winsorized Mean", and then "(1/2)Percent". In the box that */ /* pops up, choose "Other" and type, say, 10 in "Value" for the 10% trimmed mean. */ /* You can copy and paste the graphs from PROC INSIGHT into Microsoft Word */ /* Click on the border of the box you want, and copy and paste as normal */ /* To quit PROC INSIGHT or remove the INSIGHT graphs, */ /* click the X in the upper right box of the graph(s) */