EXST7005 Fall2010 03b Appendix 01

EXST7005 Fall2010 03b Appendix 01 - Statistical Methods I...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Statistical Methods I (EXST 7005) Appendix 1 Page 164 1 ***************************************; 2 *** Data from Freund & Wilson, 1997 ***; 3 *** TABLE 1.2 - HOUSES DATA ***; 4 ***************************************; 5 dm'log;clear;output;clear'; 6 OPTIONS LS=99 PS=512 nocenter nodate nonumber; 7 8 ODS HTML style=minimal body='C:\EXST 7005\SAS\Example01.html' ; NOTE: Writing HTML Body file: C:\EXST 7005\SAS\Example01.html 10 ODS RTF style=minimal body='C:\EXST 7005\SAS\Example01.rtf' ; NOTE: Writing RTF Body file: C:\EXST 7005\SAS\Example01.rtf 12 ODS PDF style=minimal body='C:\EXST 7005\SAS\Example01.PDF'; NOTE: Writing ODS PDF output to DISK destination "C:\EXST 7005\SAS\Example01.PDF", printer "PDF". 13 14 TITLE1 'Introductory SAS example 1'; 15 16 DATA HouseSales; INFILE CARDS MISSOVER; 17 TITLE2 'Analysis of house sale price data'; 18 TITLE3 'Table 1.1 from Freund & Wilson, 1997'; 19 INPUT OBS QUALITY $ EXTERIOR $ DSQF SP; 20 CARDS; NOTE: The data set WORK.HOUSESALES has 42 observations and 5 variables. NOTE: DATA statement used (Total process time): real time 0.03 seconds cpu time 0.03 seconds 20 ! RUN; 63 ; 64 PROC PRINT DATA=HouseSales; RUN; NOTE: There were 42 observations read from the data set WORK.HOUSESALES. NOTE: The PROCEDURE PRINT printed page 1. NOTE: PROCEDURE PRINT used (Total process time): real time 0.09 seconds cpu time 0.03 seconds Introductory SAS example 1 Analysis of house sale price data Table 1.1 from Freund & Wilson, 1997 Obs OBS QUALITY EXTERIOR DSQF SP 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 POOR POOR POOR POOR POOR POOR MEDIUM MEDIUM MEDIUM MEDIUM GOOD MEDIUM POOR MEDIUM MEDIUM MEDIUM MEDIUM GOOD MEDIUM GOOD FRAME FRAME FRAME FRAME FRAME FRAME BRICK BRICK BRICK BRICK BRICK BRICK FRAME BRICK BRICK BRICK BRICK BRICK BRICK BRICK 0.816 0.907 0.938 1.032 1.100 1.180 1.278 1.289 1.320 1.328 1.337 1.366 1.382 1.387 1.426 1.436 1.440 1.447 1.450 1.498 19.000 19.800 15.000 18.900 25.500 25.900 33.500 36.500 38.500 37.000 34.555 35.500 22.000 39.500 43.600 39.100 37.000 39.000 36.800 42.800 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 GOOD GOOD GOOD GOOD MEDIUM MEDIUM MEDIUM MEDIUM MEDIUM MEDIUM MEDIUM MEDIUM MEDIUM MEDIUM GOOD MEDIUM MEDIUM GOOD GOOD GOOD GOOD GOOD BRICK BRICK BRICK BRICK BRICK BRICK BRICK BRICK BRICK BRICK BRICK BRICK BRICK BRICK BRICK BRICK BRICK BRICK BRICK BRICK BRICK FRAME 1.530 1.612 1.616 1.675 1.694 1.704 1.708 1.711 1.716 1.731 1.740 1.741 1.741 1.764 1.833 1.934 1.977 2.012 2.049 2.054 2.207 2.233 46.600 43.750 49.900 35.000 44.500 48.300 42.900 43.500 49.600 54.000 48.500 49.900 48.900 39.500 55.500 46.000 47.900 52.800 56.350 58.500 61.350 75.000 James P. Geaghan Copyright 2010 Statistical Methods I (EXST 7005) Appendix 1 Page 165 66 PROC UNIVARIATE DATA=HouseSales PLOT; VAR SP; 67 TITLE4 'Proc Univariate of house sales price'; RUN; NOTE: The PROCEDURE UNIVARIATE printed page 2. NOTE: PROCEDURE UNIVARIATE used (Total process time): real time 0.12 seconds cpu time 0.03 seconds Introductory SAS example 1 Analysis of house sale price data Table 1.1 from Freund & Wilson, 1997 Proc Univariate of house sales price The UNIVARIATE Procedure Variable: SP Moments N Mean Std Deviation Skewness Uncorrected SS Coeff Variation 42 41.3739286 12.446944 -0.0453816 78247.6655 30.0840273 Sum Weights Sum Observations Variance Kurtosis Corrected SS Std Error Mean 42 1737.705 154.926414 0.48640491 6351.98298 1.92060515 Basic Statistical Measures Location Variability Mean 41.37393 Std Deviation 12.44694 Median 42.85000 Variance 154.92641 Mode 37.00000 Range 60.00000 Interquartile Range 13.40000 NOTE: The mode displayed is the smallest of 3 modes with a count of 2. Tests for Location: Mu0=0 Test -StatisticStudent's t t 21.54213 Sign M 21 Signed Rank S 451.5 -----p Value-----Pr > |t| <.0001 Pr >= |M| <.0001 Pr >= |S| <.0001 Quantiles (Definition 5) Quantile Estimate 100% Max 75.00 99% 75.00 95% 58.50 90% 55.50 75% Q3 48.90 50% Median 42.85 25% Q1 35.50 10% 22.00 5% 19.00 1% 15.00 0% Min 15.00 Extreme Observations ----Lowest---Value Obs 15.0 3 18.9 4 19.0 1 19.8 2 22.0 13 ----Highest---Value Obs 55.50 35 56.35 39 58.50 40 61.35 41 75.00 42 James P. Geaghan Copyright 2010 Statistical Methods I (EXST 7005) Stem 7 7 6 6 5 5 4 4 3 3 2 2 1 Leaf 5 Appendix 1 Page 166 Boxplot 1 1 1 668 3 00034 5 678889 6 00334444 8 5566777899 10 4 1 66 2 02 2 599 3 ----+----+----+----+ Multiply Stem.Leaf by 10**+1 0 | | | +-----+ *--+--* +-----+ | | | 0 Normal Probability Plot 77.5+ * | +++ | ++++ | +++* | +*+** | +++** 47.5+ ****** | +**** | ***+*** | **++ | ++** | ++++ * 17.5+ *+++* ** +----+----+----+----+----+----+----+----+----+----+ -2 -1 0 +1 +2 68 69 PROC MEANS DATA=HouseSales N Mean Var StdDev Min Max; VAR SP; 70 TITLE4 'Mean of house sales price'; RUN; NOTE: There were 42 observations read from the data set WORK.HOUSESALES. NOTE: The PROCEDURE MEANS printed page 3. NOTE: PROCEDURE MEANS used (Total process time): real time 0.09 seconds cpu time 0.01 seconds 71 Introductory SAS example 1 Analysis of house sale price data Table 1.1 from Freund & Wilson, 1997 Mean of house sales price The MEANS Procedure Analysis Variable : SP N Mean Variance Std Dev Minimum Maximum ---------------------------------------------------------------------------------42 41.3739286 154.9264141 12.4469440 15.0000000 75.0000000 ---------------------------------------------------------------------------------- James P. Geaghan Copyright 2010 Statistical Methods I (EXST 7005) Appendix 1 Page 167 72 PROC SORT DATA=HouseSales; BY QUALITY; RUN; NOTE: There were 42 observations read from the data set WORK.HOUSESALES. NOTE: The data set WORK.HOUSESALES has 42 observations and 5 variables. NOTE: PROCEDURE SORT used (Total process time): real time 0.00 seconds cpu time 0.00 seconds 73 PROC MEANS DATA=HouseSales N Mean Var StdDev Min Max; BY QUALITY; VAR SP; 74 TITLE4 'Mean of house sales price by house quality'; RUN; NOTE: There were 42 observations read from the data set WORK.HOUSESALES. NOTE: The PROCEDURE MEANS printed page 4. NOTE: PROCEDURE MEANS used (Total process time): real time 0.09 seconds cpu time 0.00 seconds Introductory SAS example 1 Analysis of house sale price data Table 1.1 from Freund & Wilson, 1997 Mean of house sales price by house quality QUALITY=GOOD Analysis Variable : SP N Mean Variance Std Dev Minimum Maximum ---------------------------------------------------------------------------------13 50.0850000 132.6176333 11.5159730 34.5550000 75.0000000 ---------------------------------------------------------------------------------QUALITY=MEDIUM Analysis Variable : SP N Mean Variance Std Dev Minimum Maximum ---------------------------------------------------------------------------------22 42.7500000 33.2845238 5.7692741 33.5000000 54.0000000 ---------------------------------------------------------------------------------QUALITY=POOR Analysis Variable : SP N Mean Variance Std Dev Minimum Maximum ---------------------------------------------------------------------------------7 20.8714286 15.1657143 3.8943182 15.0000000 25.9000000 ---------------------------------------------------------------------------------- 75 76 PROC FREQ DATA=HouseSales; TABLE EXTERIOR; 77 TITLE4 'Frequency table of house Exterior'; RUN; NOTE: There were 42 observations read from the data set WORK.HOUSESALES. NOTE: The PROCEDURE FREQ printed page 5. NOTE: PROCEDURE FREQ used (Total process time): real time 0.09 seconds cpu time 0.00 seconds Introductory SAS example 1 Analysis of house sale price data Table 1.1 from Freund & Wilson, 1997 Frequency table of house Exterior FREQ Procedure Cumulative Cumulative EXTERIOR Frequency Percent Frequency Percent ------------------------------------------------------------BRICK 34 80.95 34 80.95 FRAME 8 19.05 42 100.00 James P. Geaghan Copyright 2010 Statistical Methods I (EXST 7005) Appendix 1 Page 168 78 79 PROC FREQ DATA=HouseSales; TABLE QUALITY; 80 TITLE4 'Frequency table of house Quality'; RUN; NOTE: There were 42 observations read from the data set WORK.HOUSESALES. NOTE: The PROCEDURE FREQ printed page 6. NOTE: PROCEDURE FREQ used (Total process time): real time 0.14 seconds cpu time 0.00 seconds Introductory SAS example 1 Analysis of house sale price data Table 1.1 from Freund & Wilson, 1997 Frequency table of house Quality The FREQ Procedure Cumulative Cumulative QUALITY Frequency Percent Frequency Percent -----------------------------------------------------------GOOD 13 30.95 13 30.95 MEDIUM 22 52.38 35 83.33 POOR 7 16.67 42 100.00 81 82 OPTIONS PS=40; 83 PROC CHART DATA=HouseSales; VBAR QUALITY; 84 TITLE4 'Frequency table of house Quality'; RUN; NOTE: The PROCEDURE CHART printed page 7. NOTE: PROCEDURE CHART used (Total process time): real time 0.09 seconds cpu time 0.00 seconds Introductory SAS example 1 Analysis of house sale price data Table 1.1 from Freund & Wilson, 1997 Frequency table of house Quality Frequency | ***** | ***** 20 + ***** | ***** | ***** | ***** | ***** 15 + ***** | ***** | ***** ***** | ***** ***** | ***** ***** 10 + ***** ***** | ***** ***** | ***** ***** | ***** ***** ***** | ***** ***** ***** 5 + ***** ***** ***** | ***** ***** ***** | ***** ***** ***** | ***** ***** ***** | ***** ***** ***** -------------------------------------------GOOD MEDIUM POOR QUALITY James P. Geaghan Copyright 2010 Statistical Methods I (EXST 7005) Appendix 1 Page 169 86 PROC CHART DATA=HouseSales; VBAR EXTERIOR; 87 TITLE4 'Bar chart of house Exterior'; RUN; NOTE: The PROCEDURE CHART printed page 8. NOTE: PROCEDURE CHART used (Total process time): real time 0.09 seconds cpu time 0.01 seconds Introductory SAS example 1 Analysis of house sale price data Table 1.1 from Freund & Wilson, 1997 Bar chart of house Exterior Frequency | ***** | ***** 30 + ***** | ***** | ***** | ***** | ***** 20 + ***** | ***** | ***** | ***** | ***** 10 + ***** | ***** ***** | ***** ***** | ***** ***** | ***** ***** -------------------------------BRICK FRAME EXTERIOR 89 PROC CHART DATA=HouseSales; VBAR SP; 90 TITLE4 'Bar chart of house Sale Price'; RUN; NOTE: The PROCEDURE CHART printed page 9. NOTE: PROCEDURE CHART used (Total process time): real time 0.12 seconds cpu time 0.01 seconds Introductory SAS example 1 Analysis of house sale price data Table 1.1 from Freund & Wilson, 1997 Bar chart of house Sale Price Frequency | ***** | ***** | ***** 15 + ***** | ***** | ***** | ***** | ***** ***** 10 + ***** ***** | ***** ***** | ***** ***** | ***** ***** | ***** ***** ***** 5 + ***** ***** ***** ***** | ***** ***** ***** ***** | ***** ***** ***** ***** | ***** ***** ***** ***** | ***** ***** ***** ***** ***** ***** -------------------------------------------------------------------------------18 30 42 54 66 78 SP Midpoint James P. Geaghan Copyright 2010 Statistical Methods I (EXST 7005) Appendix 1 Page 170 92 PROC CHART DATA=HouseSales; HBAR QUALITY; 93 TITLE4 'Bar chart of house Quality'; RUN; NOTE: The PROCEDURE CHART printed page 10. NOTE: PROCEDURE CHART used (Total process time): real time 0.09 seconds cpu time 0.00 seconds Introductory SAS example 1 Analysis of house sale price data Table 1.1 from Freund & Wilson, 1997 Bar chart of house Quality QUALITY Freq GOOD MEDIUM POOR | |************************** | |******************************************** | |************** | ----+---+---+---+---+---+---+---+---+---+---+ 2 4 6 8 10 12 14 16 18 20 22 Frequency Cum. Freq Percent Cum. Percent 13 13 30.95 30.95 22 35 52.38 83.33 7 42 16.67 100.00 98 proc chart data=HouseSales; 99 vbar SP; 100 run; NOTE: The PROCEDURE CHART printed page 11. NOTE: PROCEDURE CHART used (Total process time): real time 0.07 seconds cpu time 0.00 seconds Introductory SAS example 1 Analysis of house sale price data Table 1.1 from Freund & Wilson, 1997 Bar chart of house Quality Frequency | ***** | ***** | ***** 15 + ***** | ***** | ***** | ***** | ***** ***** 10 + ***** ***** | ***** ***** | ***** ***** | ***** ***** | ***** ***** ***** 5 + ***** ***** ***** ***** | ***** ***** ***** ***** | ***** ***** ***** ***** | ***** ***** ***** ***** | ***** ***** ***** ***** ***** ***** -------------------------------------------------------------------------------18 30 42 54 66 78 SP Midpoint 101 Title2 'Histogram of Sale Price percentages'; 102 proc chart data=HouseSales; 103 vbar SP / type=percent; 104 run; NOTE: The PROCEDURE CHART printed page 12. NOTE: PROCEDURE CHART used (Total process time): real time 0.10 seconds cpu time 0.04 seconds James P. Geaghan Copyright 2010 Statistical Methods I (EXST 7005) Appendix 1 Page 171 Introductory SAS example 1 Histogram of Sale Price percentages Percentage | ***** 40 + ***** | ***** | ***** | ***** | ***** 30 + ***** | ***** | ***** ***** | ***** ***** | ***** ***** 20 + ***** ***** | ***** ***** | ***** ***** | ***** ***** ***** | ***** ***** ***** ***** 10 + ***** ***** ***** ***** | ***** ***** ***** ***** | ***** ***** ***** ***** | ***** ***** ***** ***** | ***** ***** ***** ***** ***** ***** -------------------------------------------------------------------------------18 30 42 54 66 78 SP Midpoint 105 Title2 'Histogram of Sale Price with midpoints specified'; 106 proc chart data=HouseSales; 107 vbar SP / midpoints =20 30 40 50 60 70 80; 108 run; NOTE: The PROCEDURE CHART printed page 13. NOTE: PROCEDURE CHART used (Total process time): real time 0.09 seconds cpu time 0.01 seconds Introductory SAS example 1 Histogram of Sale Price with midpoints specified Frequency | ***** | ***** 15 + ***** | ***** | ***** | ***** | ***** ***** 10 + ***** ***** | ***** ***** | ***** ***** | ***** ***** | ***** ***** 5 + ***** ***** ***** | ***** ***** ***** ***** ***** | ***** ***** ***** ***** ***** | ***** ***** ***** ***** ***** | ***** ***** ***** ***** ***** ***** -------------------------------------------------------------------------------------------20 30 40 50 60 70 80 SP Midpoint 109 110 Title2 'Horizontal bar chart with midpoints specified'; 111 proc chart data=HouseSales; 112 hbar SP / midpoints = 20 to 80 by 10; 113 run; NOTE: The PROCEDURE CHART printed page 14. NOTE: PROCEDURE CHART used (Total process time): real time 0.18 seconds cpu time 0.01 seconds James P. Geaghan Copyright 2010 Statistical Methods I (EXST 7005) Appendix 1 Page 172 Introductory SAS example 1 Horizontal bar chart of Sale Price with midpoints specified SP Midpoint | 20 |********** | 30 |******** | 40 |********************************** | 50 |********************** | 60 |******** | 70 | | 80 |** | ----+---+---+---+---+---+---+---+-2 4 6 8 10 12 14 16 Frequency Freq Cum. Freq Percent Cum. Percent 5 5 11.90 11.90 4 9 9.52 21.43 17 26 40.48 61.90 11 37 26.19 88.10 4 41 9.52 97.62 0 41 0.00 97.62 1 42 2.38 100.00 114 Title2 'Pie chart of Sale Price frequency'; 115 proc gchart data=HouseSales; 116 pie QUALITY; 117 run; NOTE: 51 RECORDS WRITTEN TO C:\EXST 7005\SAS\gchart.gif 118 Title2 'Star chart of Sale Price frequency'; NOTE: There were 42 observations read from the data set WORK.HOUSESALES. NOTE: PROCEDURE GCHART used (Total process time): real time 2.37 seconds cpu time 0.29 seconds James P. Geaghan Copyright 2010 Statistical Methods I (EXST 7005) Appendix 1 Page 173 119 proc gchart data=HouseSales; 120 star QUALITY; 121 run; NOTE: 49 RECORDS WRITTEN TO C:\EXST 7005\SAS\gchart1.gif 122 Title2 'Donut chart of Sale Price frequency'; NOTE: There were 42 observations read from the data set WORK.HOUSESALES. NOTE: PROCEDURE GCHART used (Total process time): real time 1.88 seconds cpu time 0.49 seconds 123 124 125 NOTE: proc gchart data=HouseSales; donut QUALITY; run; 53 RECORDS WRITTEN TO C:\EXST 7005\SAS\gchart2.gif 126 127 OPTIONS PS=99; 128 129 ods html close; 130 ods rtf close; 131 ods PDF close; NOTE: ODS PDF printed 20 pages to C:\EXST 7005\SAS\Example01.PDF. 132 133 run; 134 quit; NOTE: There were 42 observations read from the data set WORK.HOUSESALES. NOTE: PROCEDURE GCHART used (Total process time): real time 3.52 seconds cpu time 0.46 seconds James P. Geaghan Copyright 2010 ...
View Full Document

This note was uploaded on 12/29/2011 for the course EXST 7005 taught by Professor Geaghan,j during the Fall '08 term at LSU.

Ask a homework question - tutors are online