170 likes | 211 Views
Laboratory 1. Introduction to SAS. Statistical Analysis System Package for data entry data manipulation data storage data analysis reporting. SAS Screen. Handout Three opening windows Program (PGM) window ……Input Log window …… Record of what SAS did
E N D
Laboratory 1.Introduction to SAS • Statistical Analysis System • Package for • data entry • data manipulation • data storage • data analysis • reporting
SAS Screen • Handout • Three opening windows • Program (PGM) window ……Input • Log window …… Record of what SAS did • Output window ….. Results of analysis • All windows can be printed or saved
SAS Screen • Menu bar • Global: Main access to different windows • Local: Commands specific to the active window • File: Open, save, print, etc. • Edit: Modifying window contents • Journal: saving current window for easy printing • Help
SAS Input • DATA step • define and name a data set • allows input of data • define new variables • manipulate variables • generate variables • PROC step (procedures) • doing things to data; analysis
A data set • Imagine a data set as you would write it on a page • Or as it would exist in Excel • Rows are observations • Columns are variables • In cells are values
A data set OBS Var1 Var2 Var3 1 4 red 10 2 5 blue 4 3 5 red 11 4 8 green 8 5 7 green 7 ...
Temporary Exist only while SAS is running Can be reused, but disapper when SAS is closed Data saved in the Library WORK Permanent Saved on disk (Hard or Floppy) Exist after SAS is closed Files end in .SSD Must use two level name < library.file-name > Data saved in another defined library (e.g., SASUSER, other name) SAS data sets
Saving input and permanent data sets • Do not put these on the Hard Disk Drives in NSLB 121 • Save to FLOPPY only • Open saved input just as any windows file
SAS Data Sets • Data sets must have names • Eight characters … letters or numbers • Begin with a letter • Variables must have names • Eight characters … letters or numbers • Values of variables may be numeric or character • character variables are not treated as numbers
DATA step functions • LOG • LOGX = LOG10(X); • LOGY = LOG(Y); • SQRT • SROOT = SQRT(X); • + - multiply ( * ) divide ( / ) power ( ** ) • NEWVAR = 10*( X + Y/2 ) - X**3 ;
UNIVARIATE CHART PLOT SORT CORR PRINT TTEST NPAR1WAY GLM REG VARCOMP NESTED Procedures
Procedures • UNIVARIATE - all summary statistics • mean, SD, Variance, and a lot more • CHART - Bar charts, also pie charts • PLOT - bivariate plots • CORR - correlation coefficients • PRINT - what it says • SORT - orders data set
Guided Data Analysis(SAS / LAB) • Automated, menu driven, window • Data set • Response, Factors, Model • used for analysis • Summarize • summary statistics • plots • Analyze • inferential statistics
Guided Data Analysis • Fields (Data set:, Analysis:, etc.) • you fill in information • Click field -- opens a menu • e.g., Data set: field opens data window • Lists available data sets • CREATE button for creating new data sets • Summarize, Analyze produce output
Guided Data Analysis • Journal menu • Save current text • Save current graph • Review • Text - review entire saved text • Graph - review graphs 1 at a time • Print