20PROC_TTest

# 20PROC_TTest - Statistical Techniques I EXST7005 SAS PROC...

This preview shows pages 1–14. Sign up to view the full content.

Statistical Techniques I EXST7005 SAS PROC TTEST

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
SAS PROC TTEST We would normally do two-sample t-tests with SAS PROC TTEST. This procedure has the structure proc ttest data = dataset name ; class group variable ; var variable of interest ;
SAS PROC TTEST (continued) The PROC statement is familiar, and functions a any other proc statement. The VARIABLE or VAR statement works the same as in other procedures we have seen. The CLASS statement is new. It specifies th variable that will allow SAS to distinguish between the two sample groups to be tested

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
PROC TTEST EXAMPLE 1 Corn silage was fed to sheep and steers. The objective was to determine if the percent digestibility differed for the two types of animals
Example 1: Raw data Obs Sheep Steers 1 57.8 64.2 2 56.2 58.7 3 61.9 63.1 4 54.4 62.5 5 53.6 59.8 6 56.4 59.2 7 53.2

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Example 1: Raw data (continued) Unfortunately this data is not structured properly for PROC TTEST. It has two variables (sheep and steers) giving the percent digestibility for sheep and steers separately. We need one variable with percent digestibility for both and a second variable specifying the type of animal. This can be fixed in the data step.
Example 1: SAS Program data silage; infile cards missover; TITLE1 ' Percent digestibility of corn silage '; LABEL animal = 'Type of animal tested'; LABEL percent = 'Percent digestibility'; input sheep steers; animal='Sheep '; percent=sheep; output; animal='Steers'; percent=steers; output; cards;

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Example 1: SAS output of modified data set proc print data=silage; var animal percent; run; OBS ANIMAL PERCENT 1 Sheep 53.2 2 Sheep 53.6 3 Sheep 54.4 4 Sheep 56.2 5 Sheep 56.4 6 Sheep 57.8
Example 1: SAS output of modified data set (continued) 7 Sheep 61.9 8 Steers . 9 Steers 58.7 10 Steers 59.2 11 Steers 59.8 12 Steers 62.5 13 Steers 63.1 14 Steers 64.2

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
OBS ANIMAL PERCENT 1 Sheep 57.8 2 Steers 64.2 3 Sheep 56.2 4 Steers 58.7 5 Sheep 61.9 6 Steers 63.1 7 Sheep 54.4 8 Steers 62.5 9 Sheep 53.6 10 Steers 59.8 11 Sheep 56.4 12 Steers 59.2 13 Sheep 53.2 Example 1: SAS output of modified data set
Example 1: SAS Program (continued) proc ttest data=silage; class animal; var percent; run;

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Example 1: SAS OUTPUT Some intermediate statistics Percent digestibility of corn silage TTEST PROCEDURE Variable: PERCENT Percent digestibility ANIMAL N Mean Std Dev Std Error ------------------------------------------------------------------------------------------------ Sheep 7 56.21428571 3.00245931 1.13482295 Steers 6 61.25000000 2.30195569 0.93976948
Example 1: SAS OUTPUT (continued) The t-test results Variances T DF Prob>|T| ------------------------------------------------------ Unequal -3.4177 10.9 0.0058 Equal -3.3442 11.0 0.0065 For H0: Variances are equal, F' = 1.70 DF = (6,5) Prob>F' = 0.5764

This preview has intentionally blurred sections. Sign up to view the full version.

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

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

### Page1 / 51

20PROC_TTest - Statistical Techniques I EXST7005 SAS PROC...

This preview shows document pages 1 - 14. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online