EXST7005 Fall2010 10b Appendix 02

EXST7005 Fall2010 10b Appendix 02 - 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 2 Page 174 1 dm'log;clear;output;clear'; 2 OPTIONS LS=99 PS=512 nocenter nodate nonumber; 3 **********************************************; 4 *** t-tests done with SAS Proc Univariate ***; 5 **********************************************; 6 ODS HTML style=minimal body='C C:\EXST 7005\SAS\Example02.html' ; NOTE: Writing HTML Body file: C:\EXST 7005\SAS\Example02.html 7 ODS RTF style=minimal body='C:\EXST 7005\SAS\Example02.rtf'; NOTE: Writing RTF Body file: C:\EXST 7005\SAS\Example02.rtf 8 ODS PDF style=minimal body='C:\EXST 7005\SAS\Example02.PDF'; NOTE: Writing ODS PDF output to DISK destination "C:\EXST 7005\SAS\Example02.PDF", printer "PDF". 9 10 TITLE1 'Example02: One sample t-tests'; 11 12 DATA monkeys; INFILE CARDS MISSOVER; 13 TITLE2 'Analysis of Blood Pressure change in Rhesus Monkies'; 14 INPUT BPChange; 15 CARDS; NOTE: The data set WORK.MONKEYS has 10 observations and 1 variables. NOTE: DATA statement used (Total process time): real time 0.29 seconds cpu time 0.01 seconds 15 ! RUN; 26 ; 27 PROC PRINT DATA=monkeys; 28 TITLE3 'Raw data listing'; 29 RUN; NOTE: There were 10 observations read from the data set WORK.MONKEYS. NOTE: The PROCEDURE PRINT printed page 1. NOTE: PROCEDURE PRINT used (Total process time): real time 0.61 seconds cpu time 0.03 seconds One sample t-tests Analysis of Blood Pressure change in Rhesus Monkies Raw data listing Obs 1 2 3 4 5 6 7 8 9 10 BPChange 0 4 -3 2 0 1 -4 5 -1 4 James P. Geaghan Copyright 2010 Statistical Methods I (EXST 7005) Appendix 2 Page 175 30 31 PROC UNIVARIATE DATA=monkeys PLOT; VAR BPChange; 32 TITLE3 'Proc Univariate on Blood Pressure Change'; 33 RUN; NOTE: The PROCEDURE UNIVARIATE printed page 2. NOTE: PROCEDURE UNIVARIATE used (Total process time): real time 0.10 seconds cpu time 0.01 seconds One sample t-tests Analysis of Blood Pressure change in Rhesus Monkies Proc Univariate on Blood Pressure Change The UNIVARIATE Procedure Variable: BPChange Moments N Mean Std Deviation Skewness Uncorrected SS Coeff Variation 10 0.8 3.01109061 -0.157506 88 376.386326 Sum Weights Sum Observations Variance Kurtosis Corrected SS Std Error Mean Basic Statistical Measures Location Variability Mean 0.800000 Std Deviation Median 0.500000 Variance Mode 0.000000 Range Interquartile Range 10 8 9.06666667 -0.9577747 81.6 0.95219046 3.01109 9.06667 9.00000 5.00000 NOTE: The mode displayed is the smallest of 2 modes with a count of 2. Tests for Location: Mu0=0 Test -StatisticStudent's t t 0.840168 Sign M 1 Signed Rank S 6.5 -----p Value-----Pr > |t| 0.4226 Pr >= |M| 0.7266 Pr >= |S| 0.3984 Quantiles (Definition 5) Quantile Estimate 100% Max 5.0 99% 5.0 95% 5.0 90% 4.5 75% Q3 4.0 50% Median 0.5 25% Q1 -1.0 10% -3.5 5% -4.0 1% -4.0 0% Min -4.0 James P. Geaghan Copyright 2010 Statistical Methods I (EXST 7005) Extreme Observations ----Lowest---Value Obs -4 7 -3 3 -1 9 0 5 0 1 Stem 4 2 0 -0 -2 -4 Appendix 2 Page 176 ----Highest--Value Obs 1 6 2 4 4 2 4 10 5 8 Leaf Boxplot 000 0 000 0 0 0 ----+----+----+----+ 3 1 3 1 1 1 +-----+ | | *--+--* +-----+ | | Normal Probability Plot 5+ * *++++*++ | *++++++ | * +*+*++ | ++*++++ | *++++* -5+ +++++++ +----+----+----+----+----+----+----+----+----+----+ -2 -1 0 +1 +2 34 PROC ttest DATA=monkeys; VAR BPChange; 35 TITLE3 'Proc TTEST on Blood Pressure Change'; 36 RUN; NOTE: There were 10 observations read from the data set WORK.MONKEYS. NOTE: The PROCEDURE TTEST printed page 3. NOTE: PROCEDURE TTEST used (Total process time): real time 0.07 seconds cpu time 0.01 seconds One sample t-tests Analysis of Blood Pressure change in Rhesus Monkies Proc TTEST on Blood Pressure Change The TTEST Procedure Statistics Variable BPChange T-Tests Variable BPChange N 10 Lower CL Mean -1.354 DF 9 Mean 0.8 Upper CL Mean 2.954 t Value 0.84 Lower CL Std Dev 2.0711 Std Dev 3.0111 Upper CL Std Dev 5.4971 Std Err 0.9522 Minimum -4 Maximum 5 Pr > |t| 0.4226 James P. Geaghan Copyright 2010 Statistical Methods I (EXST 7005) Appendix 2 Page 177 43 ****************************************************************; 44 *** A shipment of apples are supposed to have a diameter of ***; 45 *** at least 2.5 inches. Sample 12 apples and test the ***; 46 *** hypothesis that the mean size is equal 2.5 inches. ***; 47 *** Reject the shipment if LESS THAN 2.5 inches. ***; 48 ****************************************************************; 49 50 OPTIONS LS=99 PS=256 nocenter nonumber nodate; 51 TITLE1 'One sample t-tests'; 52 TITLE2 'Test the diameter of apples against 2.5 inches'; 53 54 data apples; infile cards missover; 55 LABEL diam = 'Diameter of the apple'; 56 input diam; diff = diam - 2.5; 57 cards; NOTE: The data set WORK.APPLES has 12 observations and 2 variables. NOTE: DATA statement used (Total process time): real time 0.00 seconds cpu time 0.00 seconds 57 ! run; 70 ; 71 proc print data=apples; var diam diff; 72 TITLE3 'Raw data listing'; 73 run; NOTE: There were 12 observations read from the data set WORK.APPLES. NOTE: The PROCEDURE PRINT printed page 4. NOTE: PROCEDURE PRINT used (Total process time): real time 0.06 seconds cpu time 0.00 seconds One sample t-tests Test the diameter of apples against 2.5 inches Raw data listing Obs diam diff 1 2 3 4 5 6 7 8 9 10 11 12 2.9 2.1 2.4 2.8 3.1 2.8 2.7 3.0 2.4 3.2 2.3 3.4 0.4 -0.4 -0.1 0.3 0.6 0.3 0.2 0.5 -0.1 0.7 -0.2 0.9 74 75 proc univariate data=apples plot; var diam; 76 TITLE3 'Proc Univariate on Apple size'; 77 run; NOTE: The PROCEDURE UNIVARIATE printed page 5. NOTE: PROCEDURE UNIVARIATE used (Total process time): real time 0.14 seconds cpu time 0.03 seconds One sample t-tests Test the diameter of apples against 2.5 inches Proc Univariate on Apple size James P. Geaghan Copyright 2010 Statistical Methods I (EXST 7005) Appendix 2 Page 178 The UNIVARIATE Procedure Variable: diam (Diameter of the apple) Moments N Mean Std Deviation Skewness Uncorrected SS Coeff Variation 12 2.75833333 0.39418116 -0.1184219 93.01 14.2905557 Sum Weights Sum Observations Variance Kurtosis Corrected SS Std Error Mean Basic Statistical Measures Location Variability Mean 2.758333 Std Deviation Median 2.800000 Variance Mode 2.400000 Range Interquartile Range 12 33.1 0.15537879 -0.8352969 1.70916667 0.1137903 0.39418 0.15538 1.30000 0.65000 NOTE: The mode displayed is the smallest of 2 modes with a count of 2. Tests for Location: Mu0=0 Test -StatisticStudent's t t 24.2405 Sign M 6 Signed Rank S 39 Quantiles (Definition 5) Quantile Estimate 100% Max 3.40 99% 3.40 95% 3.40 90% 3.20 75% Q3 3.05 50% Median 2.80 25% Q1 2.40 10% 2.30 5% 2.10 1% 2.10 0% Min 2.10 Extreme Observations ----Lowest---Value Obs 2.1 2 2.3 11 2.4 9 2.4 3 2.7 7 Stem 34 32 30 28 26 24 22 20 -----p Value-----Pr > |t| <.0001 Pr >= |M| 0.0005 Pr >= |S| 0.0005 ----Highest--Value Obs 2.9 1 3.0 8 3.1 5 3.2 10 3.4 12 Leaf Boxplot 0 0 00 000 0 00 0 0 ----+----+----+----+ Multiply Stem.Leaf by 10**-1 1 1 2 3 1 2 1 1 | | +-----+ *-----* | + | +-----+ | | James P. Geaghan Copyright 2010 Statistical Methods I (EXST 7005) Appendix 2 Page 179 Normal Probability Plot 3.5+ *+++++ | *+++++ | * +*+++ | * *+*+++ | +*++++ | +*++* | +++*+ 2.1+ +++*+ +----+----+----+----+----+----+----+----+----+----+ -2 -1 0 +1 +2 78 proc univariate data=apples plot; var diff; 79 TITLE3 'Proc Univariate on Apple size difference'; 80 run; NOTE: The PROCEDURE UNIVARIATE printed page 6. NOTE: PROCEDURE UNIVARIATE used (Total process time): real time 0.10 seconds cpu time 0.04 seconds One sample t-tests Test the diameter of apples against 2.5 inches Proc Univariate on Apple size difference The UNIVARIATE Procedure Variable: diff Moments N Mean Std Deviation Skewness Uncorrected SS Coeff Variation 12 0.25833333 0.39418116 -0.1184219 2.51 152.586256 Sum Weights Sum Observations Variance Kurtosis Corrected SS Std Error Mean Basic Statistical Measures Location Variability Mean 0.25833 Std Deviation Median 0.30000 Variance Mode -0.10000 Range Interquartile Range 12 3.1 0.15537879 -0.8352969 1.70916667 0.1137903 0.39418 0.15538 1.30000 0.65000 NOTE: The mode displayed is the smallest of 2 modes with a count of 2. Tests for Location: Mu0=0 Test -StatisticStudent's t t 2.270258 Sign M 2 Signed Rank S 25 Quantiles (Definition 5) Quantile Estimate 100% Max 0.90 99% 0.90 95% 0.90 90% 0.70 75% Q3 0.55 -----p Value-----Pr > |t| 0.0443 Pr >= |M| 0.3877 Pr >= |S| 0.0493 50% Median 25% Q1 10% 5% 1% 0% Min 0.30 -0.10 -0.20 -0.40 -0.40 -0.40 James P. Geaghan Copyright 2010 Statistical Methods I (EXST 7005) Extreme Observations ----Lowest---Value Obs -0.4 2 -0.2 11 -0.1 9 -0.1 3 0.2 7 Stem 8 6 4 2 0 -0 -2 -4 Leaf 0 00 00 000 Appendix 2 Page 180 ----Highest--Value Obs 0.4 1 0.5 8 0.6 5 0.7 10 0.9 12 Boxplot 1 2 2 3 00 2 0 1 0 1 ----+----+----+----+ Multiply Stem.Leaf by 10**-1 | | +-----+ *--+--* | | +-----+ | | Normal Probability Plot 0.9+ ++*++ | *++*++ | *+*+++ | * *++++ | +++++ | *++*+ | *++++ -0.5+ +++++ +----+----+----+----+----+----+----+----+----+----+ -2 -1 0 +1 +2 81 proc ttest data=apples H0=2.5; var diam; 82 TITLE3 'Proc TTEST on Apple size'; 83 run; NOTE: There were 12 observations read from the data set WORK.APPLES. NOTE: The PROCEDURE TTEST printed page 7. NOTE: PROCEDURE TTEST used (Total process time): real time 0.12 seconds cpu time 0.00 seconds One sample t-tests Test the diameter of apples against 2.5 inches Proc TTEST on Apple size The TTEST Procedure Statistics Variable diam T-Tests Variable diam N 12 Lower CL Mean 2.5079 DF 11 Mean 2.7583 Upper CL Mean 3.0088 t Value 2.27 Lower CL Std Dev 0.2792 Std Dev 0.3942 Upper CL Std Dev 0.6693 Std Err 0.1138 Minimum 2.1 Maximum 3.4 Pr > |t| 0.0443 James P. Geaghan Copyright 2010 Statistical Methods I (EXST 7005) Appendix 2 Page 181 84 85 86 *********************************************************************; 87 *** Test for differences in seed production at two levels on a ***; 88 *** plant (top and bottom). We have ten vigorous plants bearing ***; 89 *** lucerne flowers. We want to test for differences in the ***; 90 *** number of seeds for the average of two pods in each position. ***; 91 *********************************************************************; 92 93 OPTIONS LS=99 PS=256 nocenter nonumber nodate; 94 TITLE1 'One sample t-tests'; 95 TITLE2 'Test comparing seed production for lucerne flowers'; 96 97 data flowers; infile cards missover; 98 TITLE3 'Seed production for top and bottom flowers'; 99 LABEL top = 'Flowers from the top of the plant'; 100 LABEL bottom = 'Flowers from the bottom of the plant'; 101 LABEL diff = 'Difference between top and bottom'; 102 input top bottom; 103 diff = top - bottom; 104 cards; NOTE: The data set WORK.FLOWERS has 10 observations and 3 variables. NOTE: DATA statement used (Total process time): real time 0.00 seconds cpu time 0.00 seconds 104 ! run; 115 ; 116 proc print data=flowers; var top bottom diff; 117 TITLE4'Raw data listing'; 118 run; NOTE: There were 10 observations read from the data set WORK.FLOWERS. NOTE: The PROCEDURE PRINT printed page 8. NOTE: PROCEDURE PRINT used (Total process time): real time 0.07 seconds cpu time 0.00 seconds One sample t-tests Test comparing seed production for lucerne flowers Seed production for top and bottom flowers Raw data listing Obs top bottom diff 1 2 3 4 5 6 7 8 9 10 4.0 5.2 5.7 4.2 4.8 3.9 4.1 3.0 4.6 6.8 4.4 3.7 4.7 2.8 4.2 4.3 3.5 3.7 3.1 1.9 -0.4 1.5 1.0 1.4 0.6 -0.4 0.6 -0.7 1.5 4.9 119 120 proc univariate data=flowers plot; var diff; 121 TITLE4'Proc Univariate on difference between top and bottom'; 122 run; NOTE: The PROCEDURE UNIVARIATE printed page 9. NOTE: PROCEDURE UNIVARIATE used (Total process time): real time 0.15 seconds cpu time 0.06 seconds James P. Geaghan Copyright 2010 Statistical Methods I (EXST 7005) Appendix 2 Page 182 One sample t-tests Test comparing seed production for lucerne flowers Seed production for top and bottom flowers Proc Univariate on difference between top and bottom The UNIVARIATE Procedure Variable: diff (Difference between top and bottom) Moments N Mean Std Deviation Skewness Uncorrected SS Coeff Variation 10 1 1.59861051 1.66938453 33 159.861051 Sum Weights Sum Observations Variance Kurtosis Corrected SS Std Error Mean Basic Statistical Measures Location Variability Mean 1.000000 Std Deviation Median 0.800000 Variance Mode 0.600000 Range Interquartile Range Tests for Location: Mu0=0 Test -StatisticStudent's t t 1.978141 Sign M 2 Signed Rank S 19.5 10 10 2.55555556 3.93459317 23 0.50552503 1.59861 2.55556 5.60000 1.90000 -----p Value-----Pr > |t| 0.0793 Pr >= |M| 0.3438 Pr >= |S| 0.0469 Quantiles (Definition 5) Quantile Estimate 100% Max 4.90 99% 4.90 95% 4.90 90% 3.20 75% Q3 1.50 50% Median 0.80 25% Q1 -0.40 10% -0.55 5% -0.70 1% -0.70 0% Min -0.70 Extreme Observations ----Lowest---Value Obs -0.7 8 -0.4 1 -0.4 6 0.6 7 0.6 5 Stem 4 3 2 1 0 -0 Leaf 9 ----Highest--Value Obs 1.0 3 1.4 4 1.5 9 1.5 2 4.9 10 Boxplot 0455 66 744 ----+----+----+----+ 1 0 4 2 3 +--+--+ *-----* +-----+ James P. Geaghan Copyright 2010 Statistical Methods I (EXST 7005) Appendix 2 Page 183 Normal Probability Plot 4.5+ * +++++++ | ++++++ | ++++++ | +*++*++* * | ++*++* -0.5+ * ++*++* +----+----+----+----+----+----+----+----+----+----+ -2 -1 0 +1 +2 123 proc ttest data=flowers; paired top*bottom; 124 TITLE4'Proc Univariate on difference between top and bottom'; 125 run; NOTE: There were 10 observations read from the data set WORK.FLOWERS. NOTE: The PROCEDURE TTEST printed page 10. NOTE: PROCEDURE TTEST used (Total process time): real time 0.10 seconds cpu time 0.01 seconds 126 127 ods html close; 128 ods rtf close; 129 ods PDF close; NOTE: ODS PDF printed 17 pages to C:\EXST 7005\SAS\Example02.PDF. 130 131 run; 132 quit; One sample t-tests Test comparing seed production for lucerne flowers Seed production for top and bottom flowers Proc Univariate on difference between top and bottom The TTEST Procedure Statistics Difference top - bottom T-Tests Difference top - bottom N 10 Lower CL Mean -0.144 DF 9 Mean 1 t Value 1.98 Upper CL Mean 2.1436 Lower CL Std Dev 1.0996 Std Dev 1.5986 Upper CL Std Dev 2.9184 Std Err 0.5055 Pr > |t| 0.0793 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