1 / 18

Introduction to SAS

Introduction to SAS. Outline. Overview of SAS Getting Started with SAS Data Preparation Descriptive Statistics Basic Analysis Additional Help. NYU Data Services. Tutorials and support for academic software One-on-one consultation by appointment Data Services website:

badru
Télécharger la présentation

Introduction to SAS

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introduction to SAS

  2. Outline • Overview of SAS • Getting Started with SAS • Data Preparation • Descriptive Statistics • Basic Analysis • Additional Help

  3. NYU Data Services • Tutorials and support for academic software • One-on-one consultation by appointment • Data Services website: • http://nyu.libguides.com/dataservices • Google “nyu data services” • Training tab • Slides and sample code • External resources

  4. What is SAS? • SAS is a software application for storing, preparing, analyzing and reporting data. • Comparable software packages include: R, Stata, SPSS and MATLAB. • Not heavily used within academia but the standard within most industries.

  5. Accessing SAS at NYU • In labs: • The Data Services lab • Various ITS labs • At home: • Purchase from the NYU Computer Store • Freely via the VCL (students only)

  6. SAS’s Interface • Editor – Where SAS programs/scripts are written. • Log – The record of all executed commands. • Output – The results for executed commands. • Results – An order list of executed commands with linked shortcuts to output. • Explorer – Shows SAS Libraries and the datasets contained within them.

  7. SAS Programs and Scripts • A SAS program is a text file containing instructions for the computer to run. • Programs can be created, opened, saved and run from the editor window. • SAS programs are neither space or case sensitive and all statements must end in a “;”. • Comments are initialized with “*”.

  8. DATA and PROC Steps • DATA Step • Create a new or modify an existing dataset.DATA <dataset to be saved>; SET <dataset to reference>; <optional changes to dataset>;RUN; • PROC Step • Some task related to analysis/reporting.PROC <procedure> data=<data set>; <options>;RUN;

  9. SAS Datasets and Libraries • The dataset is SAS’s only available data structure and is stored within SAS libraries. • A dataset is referenced by both its library and name: <library>.<dataset> • A LIBNAME in SAS is a shortcut reference to a Library and defined via:LIBNAME <name> “<location on computer>”;

  10. Importing Datasets • SAS can import data that comes in most formats using a DATA or PROC step. • Two common methods for importing standard, delimited, data are as follows: DATA <new dataset>; INFILE <filename> DELIMITER=“<delimiter in file>”; INPUT <variables to input>;RUN; PROC IMPORT DATAFILE=<filename> OUT=<dataset> DBMS=<file type>;RUN;

  11. Editing Data and Value Labels • A dataset can be edited in spreadsheet form by opening the dataset from the explorer window in “edit mode”. • Value labels are human-readable labels that are associated with the computer-readable numeric values of a variable. • Value labels can be created with the PROC FORMAT procedure and then applied to a procedure or dataset with the FORMAT option of a procedure or data set respectively.

  12. If Then Statements • If/Then/Else statements are an essential method for control flow. They are commonly used within loops and functions as well as when recoding variables. IF <logical statement> THEN <block of code>;ELSE <block of code>;

  13. Recoding/Computing Variables • Variables can be recoded by using IF/THEN/ELSE statements within a DATA step. • Similarly, new variables can be created using any combination of other variables within a mathematical expression within a DATA step.

  14. Descriptive Statistics • SAS offers a variety of procedures to summarize data, a few common examples include: PROC FREQ, PROC MEANS and PROC UNIVARIATE. • Each procedure has a series of optional statements, such as VAR, WHERE and BY, and specifications that allow the output to be customized.

  15. Graphics • SAS offers many different components for creating graphics, the most common of which is likely SAS/GRAPH. • Two common procedures are PROC BOXPLOTand PROC GPLOT. • Graphs can be saved using SAS ODS (Output Delivery System) or simply by right clicking and saving the graphic.

  16. Statistical Procedures • SAS has procedures for conducting all common statistical tests, including: hypothesis tests, linear models, generalized linear models, time series analysis, multi-level models and many more. • For example t-tests can be conducted with PROC TTEST and linear models can be built with PROC REG.

  17. Evaluation • Please help us improve this session and others by taking the following brief anonymous survey: bit.ly/nyusas2

  18. Additional Help • The Data Services staff is available to answer SAS related questions. • Email: data.services@nyu.edu • Phone: (212)-998-3434 • Location: 5th Floor of Bobst Library • Please refer to the Data Services training page

More Related