ST500 Session 8 _Assignment 3 - analysis of variance meanmean mean mean n height weight weight(adj) Weight(adj) male 10 63.9 108.9 102.8 103.2 female 9 60.6 90.1 96.2 96.5 19 62.2(unwt'd) (SPSS uses (SAS uses 62.3(wt'd) unwt'd) wt'd) code: sex:m=1,f=2 SAS: pg 1 wt=127-18.8(sex) pg 2wt=-143+3.9(ht0 pg 3wt=-119-6.6(sex)+3.7(ht) Cov adj: SPSS wt=wt+3.7(ht-62.2) Cov adj SAS wt=wt+3.7(ht-62.3) _Regression examples for sas: ST500 homepage>Handout/Examples>regex.sas OR on lamar: ../data/regex.sas _Additional anova examples for sas: ST500homepage>Handout/Examples> anovaex.sas,aovrepms.sas,aovspl3.sas OR on lamar: ../data/anovaex.sas + ../data/aovrepms.sas + ../data/aovspl3.sas _ Additional topics 1) multiple comparisons 2)contrasts: special / polynomial 3)design/model syntax for spss + sas 4)error term specification for spss + sas _JMP Overview _Interactive execution of non-windos versions of stat proqrams to get HELP: minitab: %minitab MTB > help help MTB > stop {to exit Minitab} spss: %spss This will bring up a split screen: pgm/output windows, 'esc' key and '1' --> select the 'help' menu item 'esc' key and '0' --> select the 'exit' menu item 'esc' key and '0' ... '9' --> other menu items sas: %sas This will bring up a split screen for output and program editor. Then use arrows or tab to select Help>Extended Help To exit,go to FIle>Exit SAS/PC NOTES : File + Lib Names 1 ) LIBNAME/FILENAME for referencing permanent SAS/ASCII files, respectively. SAS statements: COMMENTS:(<--read / -->write) a)permanent files LIBNAME libref 'd:path1'; directory PATH for SAS files FILENAME fileref 'd:path2\file2.ext'; complete filename for ascii file DATA libref.FlLE1; -->d:pathl\FlLE1.SSD INFILE fileref; < --d:path2\file2.ext INPUT AGE WT; RATIO=WT/AGE; AGE,WT,RATIO in libref.FlLE1.SSD PROC PRINT; RUN; <--d:path1\FlLE1.SSD b)temporary SAS file DATA FILE1;-->d:\SAS\WORK\FILE1.SSD(erased) INFILE . . . ; INPUT . . . ; c)temporary SAS file DATA; -->d:\SAS\WORK\DATA1.SSD(erased) INFILE . . .; (DATAi is incremented for each subsequent DATA step) INPUT . . ; 2)referencing SAS and ASCII files ASCII files SAS files (.SSD extender) READ: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - FILENAME fileref 'd:path\file.ext'; LIBNAME libref 'd:path'; DATA; INFILE fileref; DATA; SET libref.file; (DATA- (INFlLE 'd:path\file.ext';) <--d:path\file.SSD step) INPUT variables; < --d:path\file.ext LIBNAME libref 'd:path'; (PROC) PROC means DATA=libref.file; < --d:path\file.SSD WRITE: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - - - - - - - - - - - - - - FILENAME fileref 'd:path\file.ext; LIBNAME libref 'd:path'; DATA; FILE fileref; DATA libref.file; (DATA- (FILE 'd:path\file.ext;) -- > d:path\file.SSD step) PUT variables; -- > d: path\file.ext LIBNAME libref 'd:path'; (PROC) PROC means; output OUT=libref.file; -->d:path\file.SSD _______________________________________________________________________ ___________EXAMPLE______________________________________________ LIBNAME lib1 'd:path1'; LIBNAME lib2 'd:path2' ; FILENAME fileref3 'd:path3\file3.ext'; FILENAME fileref4 'd\:path4\file4.ext'; DATA lib1.AAA; -->d:path1\AAA.SSD(SAS) INFILE fileref3; INPUT age wt; <--d:path3\file3.ext (ASCII) ratio = wt/age; PROC PRINT; KEEP age ratio; <--d:path1\AAA.SSD(SAS) DATA lib2.BBB; -->d:path2\BBB.SSD(SAS) SET lib1.AAA ; <--d:path1\AAA.SSD (SAS) FILE fileref4; PUT age ratio; -->d:path4\file4.ext (ASCII) (note:PUT can write formatted) PROC PRINT; <--d:path2\BBb.SSD(SAS)