Knowing Understanding the Basics Writing your own code part 2 SAS Lab.

Slides:



Advertisements
Similar presentations
Technology Short Courses: Spring 2010 Kentaka Aruga
Advertisements

Statistical Methods Lynne Stokes Department of Statistical Science Lecture 7: Introduction to SAS Programming Language.
Slide C.1 SAS MathematicalMarketing Appendix C: SAS Software Uses of SAS  CRM  datamining  data warehousing  linear programming  forecasting  econometrics.
Spectre (Clinical) %unistats A flexible macro to give you.... “proc univariate” descriptive statistics with category counts and percentages (plus optional.
Descriptive Statistics. Descriptive Statistics: Summarizing your data and getting an overview of the dataset  Why do you want to start with Descriptive.
Introduction to SAS Programming Christina L. Ughrin Statistical Software Consulting Some notes pulled from SAS Programming I: Essentials Training.
Statistics in Science  Introducing SAS ® software Acknowlegements to David Williams Caroline Brophy.
SAS Programming: Working With Variables. Data Step Manipulations New variables should be created during a Data step Existing variables should be manipulated.
Today: Run SAS programs on Saturn (UNIX tutorial) Runs SAS programs on the PC.
Final Thoughts. When you get data… Check for Viruses Lock the files – Right click> properties>click on read only Assume the data has not been cleaned.
Descriptive Statistics In SAS Exploring Your Data.
15b. Accessing Data: Frequencies in SAS ®. 1 Prerequisites Recommended modules to complete before viewing this module  1. Introduction to the NLTS2 Training.
Basic And Advanced SAS Programming
Generating Random Samples SAS, EXCEL, JMP, SPSS. Population of Data  Sample Data should be in a dataset where each row represents an individual unit,
Social Science Research Design and Statistics, 2/e Alfred P. Rovai, Jason D. Baker, and Michael K. Ponton Mann-Whitney U Test PowerPoint Prepared by Alfred.
Copyright © 2006, SAS Institute Inc. All rights reserved. Shortcuts- what you may not know that can save you time! Elizabeth Ceranowski SAS Student Programs.
Introduction to SPSS (For SPSS Version 16.0)
Welcome to SAS…Session..!. What is SAS..! A Complete programming language with report formatting with statistical and mathematical capabilities.
Collection and Analysis of Data CPH 608 Spring 2015.
Social Science Research Design and Statistics, 2/e Alfred P. Rovai, Jason D. Baker, and Michael K. Ponton Kolmogorov-Smirnov Test PowerPoint Prepared by.
SAS Workshop Lecture 1 Lecturer: Annie N. Simpson, MSc.
ALEXANDER C. LOPILATO R: Because the names of other stat programs don’t make sense so why should this one?
Introduction to SAS BIO 226 – Spring Outline Windows and common rules Getting the data –The PRINT and CONTENT Procedures Manipulating the data.
1 Experimental Statistics - week 4 Chapter 8: 1-factor ANOVA models Using SAS.
My ODS: Real-World Uses of Modifying Table Templates Steve James Centers for Disease Control and Prevention Atlanta, Ga.
PREPARING DATA FOR STATISTICAL ANALYSIS Data Cleaning Data Cleaning Dataset Preparation Dataset Preparation Documentation Documentation 9 September 2008.
1 Experimental Statistics - week 2 Review: 2-sample t-tests paired t-tests Thursday: Meet in 15 Clements!! Bring Cody and Smith book.
SAS 介绍和举例 Presented by 经济实验教学中心 商务数据挖掘中心. Raw Data Read in Data Process Data (Create new variables) Output Data (Create SAS Dataset) Analyze Data Using.
A Brief Introduction to PROC TRANSPOSE prepared by Voytek Grus for
Knowing Understanding the Basics Writing your own code SAS Lab.
Chapter 1: Introduction to SAS  SAS programs: A sequence of statements in a particular order  Rules for SAS statements: –Every SAS statement ends in.
Data Analysis Lab 02 Using Crosstabs to compare percentages.
ISU Basic SAS commands Laboratory No. 1 Computer Techniques for Biological Research Animal Science 500 Ken Stalder, Professor Department of Animal Science.
Introduction to Enterprise Guide Jennifer Schmidt Rhonda Ellis Cassandra Hall.
1 EPIB 698E Lecture 1 Notes Instructor: Raul Cruz 7/9/13.
1 Data Manipulation (with SQL) HRP223 – 2010 October 13, 2010 Copyright © Leland Stanford Junior University. All rights reserved. Warning: This.
How to start using SAS Tina Tian. The topics An overview of the SAS system Reading raw data/ create SAS data set Combining SAS data sets & Match merging.
Laboratory 1. Introduction to SAS u Statistical Analysis System u Package for –data entry –data manipulation –data storage –data analysis –reporting.
Chapter 5 Reading and Manipulating SAS ® Data Sets and Creating Detailed Reports Xiaogang Su Department of Statistics University of Central Florida.
SAS Basics. Windows Program Editor Write/edit all your statements here. Log Watch this for any errors in program as it runs. Output Will automatically.
Analysis Introduction Data files, SPSS, and Survey Statistics.
PSC 47410: Data Analysis Workshop  What’s the purpose of this exercise?  The workshop’s research questions:  Who supports war in America?  How consistent.
HRP Copyright © Leland Stanford Junior University. All rights reserved. Warning: This presentation is protected by copyright law and.
Lesson 8 - Topics Creating SAS datasets from procedures Using ODS and data steps to make reports Using PROC RANK Programs in course notes LSB 4:11;5:3.
An Introduction Katherine Nicholas & Liqiong Fan.
Computing with SAS Software A SAS program consists of SAS statements. 1. The DATA step consists of SAS statements that define your data and create a SAS.
FORMAT statements can be used to change the look of your output –if FORMAT is in the DATA step, then the formats are permanent and stored with the dataset.
Customize SAS Output Using ODS Joan Dong. The Output Delivery System (ODS) gives you greater flexibility in generating, storing, and reproducing SAS procedure.
HRP Copyright © Leland Stanford Junior University. All rights reserved. Warning: This presentation is protected by copyright law and.
Chapter 17 Supplement: Alternatives to IF-THEN/ELSE Processing STAT 541 ©Spring 2012 Imelda Go, John Grego, Jennifer Lasecki and the University of South.
LISA SHORT COURSE SERIES: INTRODUCTION TO SAS UNIVERSITY William DeShong Fall 2015.
1 Introduction to SAS Available at
1 Data Manipulation (with SQL) HRP223 – 2009 October 12, 2009 Copyright © Leland Stanford Junior University. All rights reserved. Warning: This.
1 EPIB 698C Lecture 1 Instructor: Raul Cruz-Cano
SAS Programming Training Instructor:Greg Grandits TA: Textbooks:The Little SAS Book, 5th Edition Applied Statistics and the SAS Programming Language, 5.
HRP Copyright © Leland Stanford Junior University. All rights reserved. Warning: This presentation is protected by copyright law and.
Analyzing Data. Learning Objectives You will learn to: – Import from excel – Add, move, recode, label, and compute variables – Perform descriptive analyses.
Based on Learning SAS by Example: A Programmer’s Guide Chapters 1 & 2
Online Programming| Online Training| Real Time Projects | Certifications |Online Classes| Corporate Training |Jobs| CONTACT US: STANSYS SOFTWARE SOLUTIONS.
SAS ® 101 Based on Learning SAS by Example: A Programmer’s Guide Chapters 16 & 17 By Tasha Chapman, Oregon Health Authority.
SAS ® 101 Based on Learning SAS by Example: A Programmer’s Guide Chapters 5 & 6 By Ravi Mandal.
SAS ® 101 Based on Learning SAS by Example: A Programmer’s Guide Chapters 3 & 4 By Tasha Chapman, Oregon Health Authority.
Social Science Research Design and Statistics, 2/e Alfred P
Instructor: Raul Cruz-Cano
Tamara Arenovich Tony Panzarella
Lab 2 Data Manipulation and Descriptive Stats in R
Introduction to SAS A SAS program is a list of SAS statements executed in order Every SAS statement ends with a semicolon! SAS statements can be in caps.
Questions I need to ask myself when doing a lab write-up
Use of PROC TABULATE Out File to Customize Tables
Performing the Runs Test Using SPSS
Presentation transcript:

Knowing Understanding the Basics Writing your own code part 2 SAS Lab

Review creating the dataset Open SAS Generate a dataset called ‘mygpa_name’: –In the sasuser library –Variables: Grade, GPA –4 Observations: Grades 9 through 12 –Make up the GPA scores –Grade = numerical data type

Variables If we were using Excel, think of these as the column headings Not static – i.e. weight You can create new ones based on variables that already exist – i.e. weight2 Assign values to variables –Var = Female –Values: 1=yes0=no

Practice Step 2 – create mygpa_name dataset copy Write another dataset with the (same name) ‘mygpa_name’ to a new library ‘Work’ –Data work.mygpa_name; Open dataset mygpa_name from sasuser library to get observations. –set sasuser.mygpa_name; Highlight and Run This Look in libraries to see that (working copy) datasets are there Why did we make this copy?

Create a new variable in an existing dataset Make a variable ‘GPAconvert’ that converts current GPA (from the gpa variable) to newGPA at a rate Comment: –/*convert variable GPA from my school standard to new school standard*/ Syntax: –gpaconvert = 0.204*gpa; –Highlight and run. What happened? Why?

Procedures (Descriptive Stats) cont… NOTE: Images on these slides are different than your results! What is PROC CONTENTS for? –proc contents data = work.mygpa_name; run;

Procedures (Descriptive Statistics) What is PROC FREQ for? –proc freq data = work.mygpa_name; table group; run;

Procedures (Descriptive Stats) cont… What is PROC MEANS for? –proc means data = work.mygpa_name; var grade gpaconvert; run;

Practice Step 3 – do it again! Generate a dataset ‘CustomerList’ with the following specs: Variables: Age, PurQuantity, ItemNum, Gender, Member, NumYears ItemNum contains 3 products with associated value assigned (you make it up, but keep it numerical) Assign values to Var Gender: –Male=0, Female=1, Undetermined=2 Member is a boolean (yes/no) datatype. NumYears is where we store the number of years this customer has been a member of our loyalty programs. Create 3 Observations Put into the sasuser library Highlight and run. Check log and libraries to see that you successfully completed the task

CustomerList continued… Create a working copy of CustomerList in the Work Library. Make a new variable ‘NumMos’ that converts the current number of years of loyalty from those customers who are members to the number of months.

CustomerList continued… Generate Output (including an HTML file) for the 1.contents of the data. 2.Means of the data based on the variables of _____ and _____. 3.Frequency of the data based on the _____. 4.FILL IN THE BLANKS, highlight and RUN. (what makes most sense?)

Knowing Writing your own Code - part 2