Creating the Example Data

Slides:



Advertisements
Similar presentations
Summary Statistics/Simple Graphs in SAS/EXCEL/JMP.
Advertisements

The INFILE Statement Reading files into SAS from an outside source: A Very Useful Tool!
Statistical Methods Lynne Stokes Department of Statistical Science Lecture 7: Introduction to SAS Programming Language.
SAS Programming:File Merging and Manipulation. Reading External Files (review) data barf; * create the dataset BARF; infile ’s:\mysas\Table7.1'; * open.
S ORTING WITH SAS L ONG, VERY LONG AND LARGE, VERY LARGE D ATA Aldi Kraja Division of Statistical Genomics SAS seminar series June 02, 2008.
Case studies over control structures and iterative structures Instructor – Gokcen Cilingir Cpt S 121 (July 6, 2011) Washington State University.
Basic And Advanced SAS Programming
Using Proc Datasets for Efficiency Originally presented as a Coder’s NESUG2000 by Ken Friedman Reviewed by Karol Katz.
PROC_CODEBOOK: An Automated, General Purpose Codebook Generator
Chapter 18: Modifying SAS Data Sets and Tracking Changes 1 STAT 541 ©Spring 2012 Imelda Go, John Grego, Jennifer Lasecki and the University of South Carolina.
Understanding SAS Data Step Processing Alan C. Elliott stattutorials.com.
Into to SAS ®. 2 List the components of a SAS program. Open an existing SAS program and run it. Objectives.
Creating SAS® Data Sets
Topics in Data Management SAS Data Step. Combining Data Sets I - SET Statement Data available on common variables from different sources. Multiple datasets.
Welcome to SAS…Session..!. What is SAS..! A Complete programming language with report formatting with statistical and mathematical capabilities.
Proc Surveyselect or the easy way to select samples Gitte Churlish Churlish Consulting.
Lecture 5 Sorting, Printing, and Summarizing Your Data.
1 Experimental Statistics - week 4 Chapter 8: 1-factor ANOVA models Using SAS.
PhUSE 20141October 2014 Ziekte gebied/ Overall subject Name presenterMonth-Year Title presentation PhUSE 2014 Berber SnoeijerOct 2014 Simple and Efficient.
SAS Efficiency Techniques and Methods By Kelley Weston Sr. Statistical Programmer Quintiles.
Lesson 2 Topic - Reading in data Chapter 2 (Little SAS Book)
SAS Software Version 8 The Output Delivery System.
1 Unknown Knowns: Database Construction from Unknown Files and Variables William Klein.
1 Efficient SAS Coding with Proc SQL When Proc SQL is Easier than Traditional SAS Approaches Mike Atkinson, May 4, 2005.
1 Filling in the blanks with PROC FREQ Bill Klein Ryerson University.
Lesson 6 - Topics Reading SAS datasets Subsetting SAS datasets Merging SAS datasets.
Priya Ramaswami Janssen R&D US. Advantages of PROC REPORT -Very powerful -Perform lists, subsets, statistics, computations, formatting within one procedure.
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.
Chapter 4 concerns various SAS procedures (PROCs). Every PROC operates on: –the most recently created dataset –all the observations –all the appropriate.
Chapter 17: Formatting Data 1 STAT 541 ©Spring 2012 Imelda Go, John Grego, Jennifer Lasecki and the University of South Carolina.
Introduction to SAS Essentials Mastering SAS for Data Analytics Alan Elliott and Wayne Woodward SAS Essentials - Elliott & Woodward1.
Chapter 1: Overview of SAS System Basic Concepts of SAS System.
Controlling Input and Output
SAS Basics. Windows Program Editor Write/edit all your statement here.
Lecture 4 Ways to get data into SAS Some practice programming
14b. Accessing Data Files in SAS ®. 1 Prerequisites Recommended modules to complete before viewing this module  1. Introduction to the NLTS2 Training.
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.
Copyright © 2004, SAS Institute Inc. All rights reserved. SASHELP Datasets A real life example Barb Crowther SAS Consultant October 22, 2004.
An Introduction to Proc Transpose David P. Rosenfeld HR Consultant, Workforce Planning & Data Management City of Toronto.
17b.Accessing Data: Manipulating Variables in SAS ®
BMTRY 789 Lecture 6: Proc Sort, Random Number Generators, and Do Loops Readings – Chapters 5 & 6 Lab Problem - Brain Teaser Homework Due – HW 2 Homework.
SHRUG, F EB 2013: N ETWORKING EXERCISE Many Ways to Solve a SAS Problem.
Lesson 2 Topic - Reading in data Programs 1 and 2 in course notes –Chapter 2 (Little SAS Book)
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 8, 13, & 24 By Tasha Chapman, Oregon Health Authority.
SAS ® 101 Based on Learning SAS by Example: A Programmer’s Guide Chapters 5 & 6 By Ravi Mandal.
Beautiful PROC CONTENTS Output Using the ODS Excel Destination Suzanne Dorinski SESUG 2015 Disclaimer: Any views expressed are those of the author and.
2.3 Output Formatting. Outputting Format Specify the number of spaces, “c”, used to print an integer value with specifier %cd, e.g., %3d, %4d. E.g. printf.
SAS ® 101 Based on Learning SAS by Example: A Programmer’s Guide Chapters 3 & 4 By Tasha Chapman, Oregon Health Authority.
SAS Programming Introduction to SAS.
Basic Queries Specifying Columns
Match-Merge in the Data Step
SAS Essentials How SAS Thinks
Lesson 7 - Topics Reading SAS data sets
Quick Data Summaries in SAS
Using AMOS With SPSS Files.
Beautiful PROC CONTENTS Output Using the ODS Excel Destination
Outer Joins Inner joins returned only matching rows. When you join tables, you might want to include nonmatching rows as well as matching rows.
Inner Joins.
Examining model stability, an example
Combining Data Sets in the DATA step.
Framingham, Exam 5 subset
Appending and Concatenating Files
Fixed Effects estimate using person level data
Suggested self-checks: Section 7.11 #1-11
Sampling Distribution of the Mean in IML
Debugging.
Data tmp; do i=1 to 10; output; end; run; proc print data=tmp;
Introduction to SAS Essentials Mastering SAS for Data Analytics
RANDOM NUMBERS SET # 1:
Presentation transcript:

Creating the Example Data

The full data set proc contents data=fram.fram40;run;

Select a sample of specified size keeping only the variables desired. /*select a random sample of size 15*/ proc surveyselect data=fram.fram40(keep=spf1-spf5) out=ftmp method=srs sampsize=15 seed=54321 ; run;

Assign an id to each observation /*assign a meaningless id*/ data ftmp; length id 8; set ftmp; id=_n_; run;

Examine the data set proc print data=ftmp;run;

Changing the descriptor portion PROC DATASETS /*get rid of labels and formats*/ proc datasets lib=work memtype=data; modify ftmp; attrib _all_ label=' '; attrib _all_ format=; quit;

Sort the data in random order /*do a random sort on data*/ data ftmp; set ftmp; call streaminit(5764313); ranx=rand("uniform"); id=_n_; run; proc sort data=ftmp;by ranx;run;

Create 5 separate files /*create a separate file for each of the exams*/ data sbp1(keep=id spf1 rename=(spf1=sbp)) sbp2 (keep=id spf2 rename=(spf2=sbp)) sbp3 (keep=id spf3 rename=(spf3=sbp)) sbp4 (keep=id spf4 rename=(spf4=sbp)) sbp5 (keep=id spf5 rename=(spf5=sbp)) ; set ftmp; output sbp1; output sbp2; output sbp3; output sbp4; output sbp5; run;

Examine Results proc contents data=sbp1;run;