Syntax


The following statements are available in PROC TTEST.

  • PROC TTEST < options > ;

    • CLASS variable ;

    • PAIRED variables ;

    • BY variables ;

    • VAR variables ;

    • FREQ variable ;

    • WEIGHT variable ;

No statement can be used more than once. There is no restriction on the order of the statements after the PROC statement.

PROC TTEST Statement

  • PROC TTEST < options > ;

The following options can appear in the PROC TTEST statement.

ALPHA= p

  • specifies that confidence intervals are to be 100(1 ˆ’ p )% confidence intervals, where 0 < p < 1. By default, PROC TTEST uses ALPHA=0.05. If p is 0 or less, or 1 or more, an error message is printed.

CI=EQUAL

CI=UMPU

CI=NONE

  • specifies whether a confidence interval is displayed for ƒ and, if so, what kind. The CI=EQUAL option specifies an equal tailed confidence interval, and it is the default. The CI=UMPU option specifies an interval based on the uniformly most powerful unbiased test of H : ƒ = ƒ . The CI=NONE option requests that no confidence interval be displayed for ƒ . The values EQUAL and UMPU together request that both types of confidence intervals be displayed. If the value NONE is specified with one or both of the values EQUAL and UMPU, NONE takes precedence. For more information, see the 'Confidence Interval Estimation' section on page 4785.

COCHRAN

  • requests the Cochran and Cox (1950) approximation of the probability level of the approximate t statistic for the unequal variances situation.

DATA= SAS-data-set

  • names the SAS data set for the procedure to use. By default, PROC TTEST uses the most recently created SAS data set. The input data set can contain summary statistics of the observations instead of the observations themselves . The number, mean, and standard deviation of the observations are required for each BY group (one sample and paired differences) or for each class within each BY group (two samples). For more information on the DATA= option, see the 'Input Data Set of Statistics' section on page 4783.

H0= m

  • requests tests against m instead of 0 in all three situations (one-sample, two-sample, and paired observation t tests). By default, PROC TTEST uses H0=0.

BY Statement

  • BY variables ;

You can specify a BY statement with PROC TTEST to obtain separate analyses on observations in groups defined by the BY variables. When a BY statement appears, the procedure expects the input data set to be sorted in order of the BY variables.

If your input data set is not sorted in ascending order, use one of the following alternatives:

  • Sort the data using the SORT procedure with a similar BY statement.

  • Specify the BY statement option NOTSORTED or DESCENDING in the BY statement for the TTEST procedure. The NOTSORTED option does not mean that the data are unsorted but rather that the data are arranged in groups (according to values of the BY variables) and that these groups are not necessarily in alphabetical or increasing numeric order.

  • Create an index on the BY variables using the DATASETS procedure (in base SAS software).

For more information on the BY statement, refer to the discussion in SAS Language Reference: Concepts . For more information on the DATASETS procedure, refer to the SAS Procedures Guide .

CLASS Statement

  • CLASS variable ;

A CLASS statement giving the name of the classification (or grouping) variable must accompany the PROC TTEST statement in the two independent sample cases. It should be omitted for the one sample or paired comparison situations. If it is used without the VAR statement, all numeric variables in the input data set (except those appearing in the CLASS, BY, FREQ, or WEIGHT statement) are included in the analysis.

The class variable must have two, and only two, levels. PROC TTEST divides the observations into the two groups for the t test using the levels of this variable. You can use either a numeric or a character variable in the CLASS statement.

Class levels are determined from the formatted values of the CLASS variable. Thus, you can use formats to define group levels. Refer to the discussions of the FORMAT procedure, the FORMAT statement, formats, and informats in SAS Language Reference: Dictionary .

FREQ Statement

  • FREQ variable ;

The variable in the FREQ statement identifies a variable that contains the frequency of occurrence of each observation. PROC TTEST treats each observation as if it appears n times, where n is the value of the FREQ variable for the observation. If the value is not an integer, only the integer portion is used. If the frequency value is less than 1 or is missing, the observation is not used in the analysis. When the FREQ statement is not specified, each observation is assigned a frequency of 1. The FREQ statement cannot be used if the DATA= data set contains statistics instead of the original observations.

PAIRED Statement

  • PAIRED PairLists ;

The PairLists in the PAIRED statement identifies the variables to be compared in paired comparisons. You can use one or more PairLists . Variables or lists of variables are separated by an asterisk (*) or a colon (:). The asterisk requests comparisons between each variable on the left with each variable on the right. The colon requests comparisons between the first variable on the left and the first on the right, the second on the left and the second on the right, and so forth. The number of variables on the left must equal the number on the right when the colon is used. The differences are calculated by taking the variable on the left minus the variable on the right for both the asterisk and colon . A pair formed by a variable with itself is ignored. Use the PAIRED statement only for paired comparisons. The CLASS and VAR statements cannot be used with the PAIRED statement.

Examples of the use of the asterisk and the colon are shown in the following table.

These PAIRED statements...

yield these comparisons

PAIRED A*B;

A-B

PAIRED A*B C*D;

A-B and C-D

PAIRED (A B)h* (C D);

A-C, A-D, B-C, and B-D

PAIRED (A B) * (C B);

A-C, A-B, and B-C

PAIRED (A1-A2) * (B1-B2);

A1-B1, A1-B2, A2-B1, and A2-B2

PAIRED (A1-A2) : (B1-B2);

A1-B1 and A2-B2

VAR Statement

  • VAR variables ;

The VAR statement names the variables to be used in the analyses. One-sample comparisons are conducted when the VAR statement is used without the CLASS statement, while group comparisons are conducted when the VAR statement is used with a CLASS statement. If the VAR statement is omitted, all numeric variables in the input data set (except a numeric variable appearing in the BY, CLASS, FREQ, or WEIGHT statement) are included in the analysis. The VAR statement can be used with one- and two-sample t tests and cannot be used with the PAIRED statement.

WEIGHT Statement

  • WEIGHT variable ;

The WEIGHT statement weights each observation in the input data set by the value of the WEIGHT variable. The values of the WEIGHT variable can be nonintegral, and they are not truncated. Observations with negative, zero, or missing values for the WEIGHT variable are not used in the analyses. Each observation is assigned a weight of 1 when the WEIGHT statement is not used. The WEIGHT statement cannot be used with an input data set of summary statistics.




SAS.STAT 9.1 Users Guide (Vol. 7)
SAS/STAT 9.1 Users Guide, Volumes 1-7
ISBN: 1590472438
EAN: 2147483647
Year: 2004
Pages: 132

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net