-
Description
This example shows how to do t-test by using
MEANS procedure with options (instead of using TTEST procedure).
It performs a t-test for a natural paring of
the data,
testing a hypothesis that the mean change of two
values, i.e., before-event and after-event
values, of each observation is significantly
different from zero. Ideal for the post-audit,
comparing seasonal difference, validation of
improvement or degredation, etc.
Undelying assumption for this
TTEST procedure is
that the observations are random samples drawn
from two independent and normally distributed
populations with an equal variance.
If these assumptions could not be
satisfied or ascertained, you *should* use
Nonparametric statistics
techniques instead for testing your hypothesis.
(see
NPAR1WAY procedure)
OPTIONS LINESIZE=80;
TITLE1 'Paried Sample t-Test';
TITLE2 'Seasonal Total Suspended Solid (TSS)';
DATA TSS;
/* @@ means a loop in reading input variable sequence */
INPUT Station Spring Summer @@;
Change = Summer - Spring;
CARDS;
1 80 82 2 73 71 3 70 95 4 60 69
5 88 100 6 84 71 7 60 69 8 37 60
9 91 95 10 98 99 11 52 65 12 78 83
13 40 60 14 79 86 15 59 62
;
RUN;
/* N = number of observations in the subgroup */
/* having nonmissing values for the variable */
/* MEAN = the mean */
/* STDERR = the standard error of mean */
/* T = student's t for testing the hypothesis */
/* that the population mean is 0 */
/* PRT = the probability of a greater absolute */
/* value for the student's t */
PROC MEANS N MEAN STDERR T PRT;
VAR Change;
RUN;
|
SAS User Guide (SUG) for Procedures (PROC) used in the Source
|
-
|