*Define the linesize, pagesize, first_page_number, and left_justified output; OPTIONS LS=80 PS=66 PAGENO=1 NOCENTER; *Read the data into the SAS dataset called 'temp'. This method allows you ; *to specify the data within the datastepand is good for small data sets. ; DATA temp; INPUT treat $ response; DATALINES; B 14 B 16 A 19 A 17 B 15 A 13 A 17 ; RUN; *Set a title (1 indicates the first title level); TITLE1 "Example 1_3"; *Carry out a T-test; PROC TTEST DATA=temp CI=NONE; CLASS treat; RUN; *Clear the title for any subsequent commands; TITLE1; *---------------------------; /* An alternative way to read the data in from a URL. (This only works for version 9 of SAS). The URL keyword is needed before the web address if you are reading from the web. The URL keyword is not used if you are reading the data from a local file. ***NOTE: Exercises begin with 'ex', not 'exp'. 'exp' indicates an example from the text. */ *Define the location of the input data file, called "file1"; FILENAME file1 URL "http://www.uvm.edu/~rsingle/stat231/data/kuehl/exp1_3.txt"; DATA temp2; INFILE file1 FIRSTOBS=2 EXPANDTABS; INPUT treat $ response; RUN; PROC MEANS DATA=temp2; CLASS treat; RUN; *---------------------------; /* * Note: This section can be skipped; * Send SAS output directly to a Rich-text file (RTF) that can be opened in Word; * This is NOT necessary with the new online version of SAS; * since there are easier ways to export RTF/Word results; *Specify the name of the RTF file; ODS RTF File = "SAS-output-example-1_3.rtf"; PROC MEANS DATA=temp2; CLASS treat; RUN; PROC TTEST DATA=temp CI=NONE; CLASS treat; RUN; *Close the ODS selection; ODS RTF Close; */