dm 'log;clear;output;clear';
ods html close; ods html style=minimal body='Assignment 07 example.html';
ods graphics on;
options nodate nocenter pageno=1 ls=90 ps=56;
ODS listing;
************************************;
*** James P Geaghan ***;
*** EXST 700X t-test Examplea ***;
**********************************************************************;
*** Examples are from your text book ***;
*** Freund, Rudolph J., William J. Wilson and Donna L. Mohr. 2010. ***;
*** Statistical Methods, Academic Press (ELSIVIER), N.Y ***;
**********************************************************************;
title1 "Examples of t-tests";
***************************************;
*** First Example: Paired t-test ***;
***************************************;
title2 "The paired t-test - Pollution example";
data Pollution;
INFILE 'datatab_5_13b.txt' missover firstobs=2;
input AreaA AreaB;
diff = AreaA - AreaB;
datalines; run;
;
run;
*proc print data=Pollution; run;
proc univariate data=Pollution plot normal CIBasic;
Title3 'Paired t-test with proc univariate';
TITLE4 'Two-tailed hypothesis';
var diff;
ods exclude extremeobs quantiles;
run;
PROC ttest data=Pollution sides=u;
VAR diff;
TITLE3 'Paired t-test with Proc TTEST';
TITLE4 'One-tailed hypothesis';
TITLE5 'Testing a difference calculated in the data step';
RUN;
PROC ttest data=Pollution sides=u;
paired AreaA * AreaB;
TITLE3 'Paired t-test with Proc TTEST';
TITLE4 'One-tailed hypothesis';
TITLE5 'Alternative to testing a calculated difference';
RUN;
***************************************;
*** Second Example: Paired t-test ***;
***************************************;
title2 "The one-sample t-test - Systolic blood pressure";
data SystolicBP;
INFILE 'SystolicBP.txt' missover firstobs=2;
input BP;
datalines;
;
run;
*proc print data=SystolicBP; run;
PROC ttest data=SystolicBP H0=129 sides=u;
TITLE3 'One-sample one-tailed t-test with Proc TTEST';
VAR BP;
RUN;
proc univariate data=SystolicBP plot normal;
Title4 'Test of normality with proc univariate';
var BP;
ods exclude BasicMeasures ExtremeObs ExtremeValues Modes
Moments MissingValues Quantiles TestsForLocation;
run;
ods html close;