EXST7005 Fall2010 15b Appendix 04

# EXST7005 Fall2010 15b Appendix 04 - Statistical Methods I...

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

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 4 Page 190 1 TITLE1 'Two sample t-tests'; 2 dm'log;clear;output;clear'; 3 4 ODS HTML style=minimal body='C:\EXST 7005\SAS\Example04.html' ; NOTE: Writing HTML Body file: C:\EXST 7005\SAS\Example04.html 5 ODS RTF style=minimal body='C:\EXST 7005\SAS\Example04.rtf'; NOTE: Writing RTF Body file: C:\EXST 7005\SAS\Example04.rtf 6 ODS PDF style=minimal body='C:\EXST 7005\SAS\Example04.PDF'; NOTE: Writing ODS PDF output to DISK destination "C:\EXST 7005\SAS\Example04.PDF", printer "PDF". 7 8 ****************************************************; 9 *** Steele & Torrie (1980) Table 5.2 ***; 10 *** Percent digestability of corn silage was ***; 11 *** examined for sheep and steers. ***; 12 *****************************************************; 13 OPTIONS LS=99 PS=512 nocenter nodate nonumber; 14 15 data silage; infile cards missover; 16 TITLE2 'Percent digestability of corn silage'; 17 LABEL animal = 'Type of animal tested'; 18 LABEL percent = 'Percent digestability'; 19 input sheep steers; 20 animal = 'Sheep '; percent = sheep; output; 21 animal = 'Steers'; percent = steers; output; 22 cards; NOTE: The data set WORK.SILAGE has 14 observations and 4 variables. NOTE: DATA statement used (Total process time): real time 0.01 seconds cpu time 0.03 seconds 22 ! run; 30 ; 31 proc print data=silage; var animal percent; 32 TITLE3 'Raw data listing'; 33 run; NOTE: There were 14 observations read from the data set WORK.SILAGE. NOTE: The PROCEDURE PRINT printed page 1. NOTE: PROCEDURE PRINT used (Total process time): real time 0.07 seconds cpu time 0.01 seconds Two sample t-tests Percent digestability of corn silage Raw data listing Obs 1 2 3 4 5 6 7 8 9 10 11 12 13 14 animal Sheep Steers Sheep Steers Sheep Steers Sheep Steers Sheep Steers Sheep Steers Sheep Steers percent 57.8 64.2 56.2 58.7 61.9 63.1 54.4 62.5 53.6 59.8 56.4 59.2 53.2 . James P. Geaghan Copyright 2010 Statistical Methods I (EXST 7005) Appendix 4 Page 191 34 proc ttest data=silage; class animal; var percent; 35 TITLE3 'PROC TTEST results'; 36 run; NOTE: There were 14 observations read from the data set WORK.SILAGE. NOTE: The PROCEDURE TTEST printed page 2. NOTE: PROCEDURE TTEST used (Total process time): real time 0.07 seconds cpu time 0.00 seconds Two sample t-tests Percent digestability of corn silage PROC TTEST results The TTEST Procedure Statistics Variable animal N percent percent percent Sheep Steers Diff (1-2) 7 6 T-Tests Variable percent percent Lower CL Mean Mean Upper CL Mean Lower CL Std Dev Std Dev Upper CL Std Dev Std Err 53.437 58.834 -8.35 56.214 61.25 -5.036 58.991 63.666 -1.721 1.9348 1.4369 1.9174 3.0025 2.302 2.7066 6.6116 5.6458 4.5955 1.1348 0.9398 1.5058 Method Pooled Satterthwaite Equality of Variances Variable Method percent Folded F Variances Equal Unequal Num DF 6 Den DF 5 DF 11 10.9 t Value -3.34 -3.42 F Value 1.70 Pr > |t| 0.0065 0.0058 Pr > F 0.5764 37 38 *****************************************************; 39 *** Steele & Torrie (1980) Table 5.6 ***; 40 *** Percent fine gravel found in surface soils. ***; 41 *** Data from a study comparing characteristics ***; 42 *** of soil catagorized as "good" or "poor". ***; 43 *****************************************************; 44 45 data dirt; infile cards missover; 46 TITLE2 'Percent fine gravel in surface soils'; 47 LABEL soilqual = 'Soil quality evaluation'; 48 LABEL percent = 'Percent fine gravel'; 49 input good poor; 50 soilqual = 'good '; percent = good; output; 51 soilqual = 'poor'; percent = poor; output; 52 cards; NOTE: The data set WORK.DIRT has 14 observations and 4 variables. NOTE: DATA statement used (Total process time): real time 0.00 seconds cpu time 0.00 seconds 52 ! run; 60 ; 61 proc print data=dirt; var soilqual percent; 62 TITLE3 'Raw data listing'; 63 run; NOTE: There were 14 observations read from the data set WORK.DIRT. James P. Geaghan Copyright 2010 Statistical Methods I (EXST 7005) Appendix 4 Page 192 NOTE: The PROCEDURE PRINT printed page 3. NOTE: PROCEDURE PRINT used (Total process time): real time 0.07 seconds cpu time 0.01 seconds Two sample t-tests Percent fine gravel in surface soils Raw data listing Obs 1 2 3 4 5 6 7 soilqual good poor good poor good poor good percent 5.9 7.6 3.8 0.4 6.5 1.1 18.3 8 9 10 11 12 13 14 poor good poor good poor good poor 3.2 18.2 6.5 16.1 4.1 7.6 4.7 64 proc ttest data=dirt; class soilqual; var percent; 65 TITLE3 'PROC TTEST results'; 66 run; NOTE: There were 14 observations read from the data set WORK.DIRT. NOTE: The PROCEDURE TTEST printed page 4. NOTE: PROCEDURE TTEST used (Total process time): real time 0.10 seconds cpu time 0.00 seconds Two sample t-tests Percent fine gravel in surface soils PROC TTEST results The TTEST Procedure Statistics Variable soilqual N percent percent percent good poor Diff (1-2) 7 7 T-Tests Variable percent percent Lower CL Mean Mean Upper CL Mean Lower CL Std Dev Std Dev Upper CL Std Dev Std Err 5.0559 1.5048 1.3212 10.914 3.9429 6.9714 16.773 6.3809 12.622 4.0819 1.6987 3.4789 6.3344 2.6362 4.8515 13.949 5.8051 8.0086 2.3942 0.9964 2.5932 Method Pooled Satterthwaite Equality of Variances Variable Method percent Folded F Variances Equal Unequal Num DF 6 Den DF 6 DF 12 8.02 t Value 2.69 2.69 F Value 5.77 Pr > |t| 0.0197 0.0275 Pr > F 0.0509 James P. Geaghan Copyright 2010 Statistical Methods I (EXST 7005) 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 Appendix 4 Page 193 *******************************************************; *** Steele & Torrie (1980) Exercise 5.5.6 ***; *** The weights in grams of 10 male and 10 female ***; *** juvenile ring-necked pheasants trapped in ***; *** January in Wisconsin are given. Test the Ho ***; *** that males were 350 grams heavier than females. ***; *******************************************************; data birds; infile cards missover; TITLE2 'Weight in gms of male & female pheasants'; LABEL sex = 'Sex of pheasant'; LABEL weight = 'Weight in grams'; input sex \$ weight; if sex eq 'Male' then AdjWT = Weight - 350; else AdjWT = weight; cards; NOTE: The data set WORK.BIRDS has 20 observations and 3 variables. NOTE: DATA statement used (Total process time): real time 0.01 seconds cpu time 0.01 seconds 83 ! run; 104 ; 105 proc print data=birds; var sex weight adjwt; 106 TITLE3 'Raw data listing'; 107 run; NOTE: There were 20 observations read from the data set WORK.BIRDS. NOTE: The PROCEDURE PRINT printed page 5. NOTE: PROCEDURE PRINT used (Total process time): real time 0.09 seconds cpu time 0.01 seconds Two sample t-tests Weight in gms of male & female pheasants Raw data listing Obs 1 2 3 4 5 6 7 8 9 sex Female Female Female Female Female Female Female Female Female weight 1061 1065 1092 1017 1021 1138 1143 1094 1270 Adj WT 1061 1065 1092 1017 1021 1138 1143 1094 1270 10 11 12 13 14 15 16 17 18 19 20 Female Male Male Male Male Male Male Male Male Male Male 1028 1293 1380 1614 1497 1340 1643 1466 1627 1383 1711 1028 943 1030 1264 1147 990 1293 1116 1277 1033 1361 109 proc ttest data=birds H0=-350; class sex; var weight; 110 TITLE3 'PROC TTEST results specifying a difference'; 111 run; NOTE: There were 20 observations read from the data set WORK.BIRDS. NOTE: The PROCEDURE TTEST printed page 6. NOTE: PROCEDURE TTEST used (Total process time): real time 0.10 seconds cpu time 0.03 seconds James P. Geaghan Copyright 2010 Statistical Methods I (EXST 7005) Appendix 4 Page 194 Two sample t-tests Weight in gms of male & female pheasants PROC TTEST results specifying a difference The TTEST Procedure Statistics Variable sex weight weight weight Female Male Diff (1-2) T-Tests Variable weight weight N 10 10 Lower CL Mean Mean Upper CL Mean Lower CL Std Dev Std Dev Upper CL Std Dev Std Err 1038.1 1391 -512 1092.9 1495.4 -402.5 1147.7 1599.8 -293 52.709 100.36 88.053 76.63 145.9 116.53 139.9 266.36 172.33 24.232 46.138 52.115 Method Pooled Satterthwaite Equality of Variances Variable Method weight Folded F Variances Equal Unequal Num DF 9 DF 18 13.6 Den DF 9 t Value -1.01 -1.01 F Value 3.63 Pr > |t| 0.3271 0.3313 Pr > F 0.0686 112 proc ttest data=birds; class sex; var adjwt; 113 TITLE3 'PROC TTEST results on adjusted values'; 114 run; NOTE: There were 20 observations read from the data set WORK.BIRDS. NOTE: The PROCEDURE TTEST printed page 7. NOTE: PROCEDURE TTEST used (Total process time): real time 0.12 seconds cpu time 0.01 seconds Two sample t-tests Weight in gms of male & female pheasants PROC TTEST results on adjusted Values The TTEST Procedure Statistics Variable sex AdjWT AdjWT AdjWT Female Male Diff (1-2) T-Tests Variable AdjWT AdjWT N 10 10 Lower CL Mean Mean Upper CL Mean Lower CL Std Dev Std Dev Upper CL Std Dev Std Err 1038.1 1041 -162 1092.9 1145.4 -52.5 1147.7 1249.8 56.989 52.709 100.36 88.053 76.63 145.9 116.53 139.9 266.36 172.33 24.232 46.138 52.115 Method Pooled Satterthwaite Equality of Variances Variable Method AdjWT Folded F Variances Equal Unequal Num DF 9 Den DF 9 DF 18 13.6 t Value -1.01 -1.01 F Value 3.63 Pr > |t| 0.3271 0.3313 Pr > F 0.0686 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