1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;5556 /* classicalpain.sas */57 title "Pain data: Read from an Excel Spreadsheet";5859 proc import datafile="/folders/myfolders/Pain.xls"60 out=ouch dbms=xls replace;61 getnames=yes;62 /* Input data file is Pain.xls63 Ouput data table is called ouch64 dbms=xls The input file is an Excel spreadsheet.65 Necessary to read an Excel spreadsheet directly under unix/linux66 Works in PC environment too except for Excel 4.0 spreadsheets67 If there are multiple sheets, use sheet="sheet1" or something.68 replaceIf the data table already exists, replace it. Use this!69 getnames=yes Use column names as variable names. Beware of70 leading and trailing blanks if it's in xlsx format. */71NOTE: The import data set has 10 observations and 7 variables.NOTE: WORK.OUCH data set was successfully created.NOTE: PROCEDURE IMPORT used (Total process time):real time 0.01 secondscpu time 0.00 seconds72 proc print;7374 /* Convert to univariate format, with 6 "cases" per patient. */75NOTE: There were 10 observations read from the data set WORK.OUCH.NOTE: PROCEDURE PRINT used (Total process time):real time 0.04 secondscpu time 0.05 seconds76 data arthritis;77 set ouch;78 Drug=1; Dose=1; Pain=Drug1Dose1; output;79 Drug=1; Dose=2; Pain=Drug1Dose2; output;80 Drug=1; Dose=3; Pain=Drug1Dose3; output;81 Drug=2; Dose=1; Pain=Drug2Dose1; output;82 Drug=2; Dose=2; Pain=Drug2Dose2; output;83 Drug=2; Dose=3; Pain=Drug2Dose3; output;84 keep Patient Drug Dose Pain;85NOTE: There were 10 observations read from the data set WORK.OUCH.NOTE: The data set WORK.ARTHRITIS has 60 observations and 4 variables.NOTE: DATA statement used (Total process time):real time 0.00 secondscpu time 0.00 seconds86 proc print;87NOTE: There were 60 observations read from the data set WORK.ARTHRITIS.NOTE: PROCEDURE PRINT used (Total process time):real time 0.08 secondscpu time 0.08 seconds88 proc tabulate;89 title2 'Look at the means';90 class Drug Dose;91 var Pain;92 table (Drug all),(Dose all) * (mean*Pain);93NOTE: There were 60 observations read from the data set WORK.ARTHRITIS.NOTE: PROCEDURE TABULATE used (Total process time):real time 0.03 secondscpu time 0.03 seconds94 proc glm;95 title2 'Classical mixed model repeated measures';96 class Patient Drug Dose;97 model Pain = patient Drug|Dose;98 random Patient / test;99100101 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;113