Shortcuts for Variable Lists in SAS

Slides:



Advertisements
Similar presentations
SAS Programming:File Merging and Manipulation. Reading External Files (review) data barf; * create the dataset BARF; infile ’s:\mysas\Table7.1'; * open.
Advertisements

Chapter 4 – Modern Genetics Lesson 1
Algebra 1 Warm up. 8-8 FACTOR BY GROUPING Objective: To factor a polynomial by grouping.
I OWA S TATE U NIVERSITY Department of Animal Science Modifying and Combing SAS Data Sets (Chapter in the 6 Little SAS Book) Animal Science 500 Lecture.
How to Interpret Your Lab Results Presented by Pat Hogan, ARNP, AAHIVS Group Health Cooperative.
(2 + 1) + 4 = 2 + (1 + 4) Associative Property of Addition.
KINDS OF BLOOD TESTS. A-1-C HEMOGLOBIN ABO BLOOD TYPE.
Introduction to SAS BIO 226 – Spring Outline Windows and common rules Getting the data –The PRINT and CONTENT Procedures Manipulating the data.
Properties and Mental Computation p. 80. Math talk What are some math properties that we use? Why do you think we have them? Do you ever use them?
SAS ODS (Output Delivery System) Donald Miller 812 Oswald Tower ;
1 Data Manipulation (with SQL) HRP223 – 2010 October 13, 2010 Copyright © Leland Stanford Junior University. All rights reserved. Warning: This.
Lesson 6 - Topics Reading SAS datasets Subsetting SAS datasets Merging SAS datasets.
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.
Controlling Input and Output
Programming in R Managing Variables. Managing variables in R In this session I will show you how to: Rename, drop and keep variables Create new variables.
Multiplying Powers Dividing Powers Zero ExponentsNegative.
The Distributive Property
This initiative of SMARTVIZ MARKETING PVT. LTD. is started keeping in mind the health issues and nutritional gap in an individual, thus creating its.
(2 + 1) + 4 = 2 + (1 + 4) Associative Property of Addition.
1 Data Manipulation (with SQL) HRP223 – 2009 October 12, 2009 Copyright © Leland Stanford Junior University. All rights reserved. Warning: This.
Do not put content on the brand signature area NOBS for Noobs David B. Horvath, CCP, MS PhilaSUG Winter 2015 Meeting NOBS for Noobs.
Diagnostic Biochemistry By Professor: Ali Abdul Hussein S. AL-Janabi Dept. of Clinical laboratories, Collage of AMS, University of Karbala, Iraq 2014-
Copyright 2009 The Little Engine That Could: Using EXCEL LIBNAME Engine Options to Enhance Data Transfers between SAS® and Microsoft® Excel Files William.
prepared by Dr. Akaber Tarek Biochemistry Department Clinical Chemistry prepared by Dr. Akaber Tarek Biochemistry Department Clinical Chemistry prepared.
Fractions Addition, Subtraction, Multiplication and Division June 25, 2016June 25, 2016June 25, 2016.
SAS ® 101 Based on Learning SAS by Example: A Programmer’s Guide Chapters 3 & 4 By Tasha Chapman, Oregon Health Authority.
Anemia. Normocytic Macrocytic Microcytic Production Destruction Loss.
Introduction to Graphing in SAS
Temporary vs. Permanent SAS Data Sets
Chapter 11 Reading SAS Data
Today: Feb 28 Reading Data from existing SAS dataset One-way ANOVA
TOPIC: Genetics AIM: How are human traits inherited?
Section 1.8: Distributive Property with Variables
Copyright © 2017 American Academy of Pediatrics.
Copyright © 2017 American Academy of Pediatrics.
Basic laboratory testing
Basic Queries Specifying Columns
Basic laboratory testing
Lesson 9 - Topics Restructuring datasets LSB: 6:14
Instructor: Raul Cruz-Cano
Lesson 8 - Topics Creating SAS datasets from procedures
Match-Merge in the Data Step
Rational Approach to Patients With Unintentional Weight Loss
Data Management – Audit Trail
DATA MANAGEMENT MODULE: Managing Variables
تصنيف التفاعلات الكيميائية
Creating the Example Data
Boolean Algebra.
DATA MANAGEMENT MODULE: Managing Variables
Complex Patterns of Inheritance
SAS Libname Quiz (You have 5 mins to complete, fill in the blanks)
Inner Joins.
Medical Abbreviations
Combining Data Sets in the DATA step.
Математици-юбиляри.
Table 1. Laboratory data on admission
Data Management Module: Creating, Adding and Dropping Variables
Example, Create an analytic file for Nhanes 1999
Framingham, Exam 5 subset
Unusual Aspects of Acute Q Fever-Associated Hepatitis
Appending and Concatenating Files
Volume 24, Issue 10, Pages (October 2016)
Allegro CL Certification Program
Data tmp; do i=1 to 10; output; end; run; proc print data=tmp;
Evaluation and management of a patient with chronic pruritus
Introduction to SAS Essentials Mastering SAS for Data Analytics
Effects of pterosin A on serum levels of lipid, blood urea nitrogen (BUN), creatinine, aspartate aminotransferase (AST), and alanine aminotransferase (ALT)
Matrices - Operations MULTIPLICATION OF MATRICES
Fondaparinux (Arixtra∗) hepatotoxicity in a 6 year-old child
Fig. 5 Minimal administration of ETL is tolerable and safe in mice.
Presentation transcript:

Shortcuts for Variable Lists in SAS

Create an Nhanes 3 dataset containing body measurements.

CODE TOPIC AT Alanine aminotransferase (from biochemistry profile) AM Albumin (from biochemistry profile) AP Alkaline phosphatase (from biochemistry profile) AL Allergy skin test AC Alpha carotene AN Anisocytosis AA Apolipoprotein (AI) AB Apolipoprotein (B) AS Aspartate aminotransferase (from biochemistry profile) LA Atypical lymphocyte AU Audiometry BA Band BO Basophil BS Basophilic stippling BC Beta carotene BX Beta cryptoxanthin BL Blast BU Blood urea nitrogen (BUN) (from biochemistry profile) BM Body measurements

Prefix with : /* all body measurements begin with "bm"*/ data body; set nhanes3.exam (keep=seqn bm:); run; proc contents data=body;

Prefix with Numbered variables libname fram "&path/fram"; /*use single - for numbered variables*/ proc contents data=fram.fram40; run; data sbp20; set fram.fram40(keep=id spf1-spf20); proc print data=sbp20 (obs=5);

Rename option /*use single - for numbered variables rename option*/ data sbp20; set fram.fram40(keep=id spf1-spf20 rename=(spf1-spf20=sbp1-sbp20)); run; proc print data=sbp20 (obs=5);

Sometimes the order of variables on a file is determines their “grouping,” proc contents data=fram.fram40 position; run;

Specify contiguous variables Using -- /* double dash -- signifies all contiguous variables from the first to last specified */ data lipids; set fram.fram40(keep=ex_date--vldl); run; proc contents data=lipids; proc print data=lipids (obs=10);

Mix and Match data lipids; set fram.fram40(keep=ex_date--vldl spf1-spf20 sex chd rename=(spf1-spf20=sbp1-sbp20)); run; proc contents data=lipids; proc print data=lipids (obs=10);

Multiple Drop Options data chdmen (drop=male); set s5238.chd5238(drop=dead eversmok height smkamt weight); where male; run; proc contents data=chdmen;