Lecture_7 - Lecture7 MergingDataset Tuesday March 16th...

Info iconThis preview shows pages 1–12. Sign up to view the full content.

View Full Document Right Arrow Icon
    Lecture 7 Merging Dataset Tuesday March 16 th 10:10 – 11:00 am
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
    “ The ability to take data – to be able to understand it, to  process it, to extract  value from it, to visualize it, to communicate it – that’s  going to be a hugely  important skill in the next decades…” - Hal Varian Chief Economist for G o o g l e
Background image of page 2
    Today’s Outline Definitions Proc Contents Keep & Drop Rename Concatenating & One-to-One Merging
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
    Definitions Concatenating      Merging two or more datasets, one “above” the next, into a single dataset, using the “set” statement. Interleaving      Combining two or more sorted datasets into a single sorted data set using SET and BY statements. One-to-One Merging       Combining two or more datasets, one "to the right" of the other using the MERGE statement. Match-merging Combining two or more SAS data sets based on the values of one or more common variables using MERGE and BY statements. Updating Replacing the values of variables in a (master) data set with nonmissing values from another data set using the UPDATE and BY statements.
Background image of page 4
    Proc Contents
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
    What is in that old permanent  dataset? Very simple procedure which simply reports the file information & dataset contents: /* Display Dataset Info */ Proc Contents data =stat200.complete; run ;
Background image of page 6
    Output from Proc Contents The CONTENTS Procedure Data Set Name STAT200.COMPLETE Observations 1004 Member Type DATA Variables 119 Engine V9 Indexes 0 Created Tuesday, February 24, 2009 02:53:07 PM Observation Length 1192 Last Modified Tuesday, February 24, 2009 02:53:07 PM Deleted Observations 0 Protection Compressed NO Data Set Type Sorted YES Label Data Representation WINDOWS_32 Encoding wlatin1 Western (Windows) Engine/Host Dependent Information Data Set Page Size 16384 Number of Data Set Pages 78 First Data Page 1 Max Obs per Page 13 Obs in First Data Page 3 Number of Data Set Repairs 0 File Name F:\Data\Tutorial Examples\Stat 200\complete.sas7bdat Release Created 9.0101M3 Host Created XP_PRO
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
    Output from Proc Contents II Alphabetic List of Variables and Attributes # Variable Type Len 60 Abortion Char 8 84 Age1stDrk Num 8 38 AgeDiff Char 25 98 AgeLostIt Num 8 116 AgeLostVirginity Num 8 44 AgeMarry Num 8 86 AttkIraq Char 8 68 BevPref Char 10 55 Book_Movy Char 8 85 BushJob Char 12 51 CDsBurnd Num 8 45 CDsOwn Num 8 47 CellPhn Char 8 95 CheatTel Char 8 94 CheatdSO Char 8 66 CitedOff Num 8 80 Cocaine Char 8 37 DatePerly Char 8 34 DateRace Char 8 41 DateSpnd Num 8
Background image of page 8
    May Include   Format  Column The CONTENTS Procedure Alphabetic List of Variables and Attributes # Variable Type Len Format 24 MRK Num 8 25 MSFT Num 8 26 PFE Num 8 27 PG Num 8 28 UTX Num 8 29 VZ Num 8 30 WMT Num 8 31 XOM Num 8 1 tradingDay Num 8 MMDDYY6.
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
    Drop & Keep Data Procedure
Background image of page 10
    Data Procedure Source Embedded Dataset File (Text file, CSV, etc.) SAS Permanent Data File Contents Input Statement Recoding & Creating Variables Creating a Subset Merging Two Datasets Drop, Keep, & Rename
Background image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 12
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/27/2011 for the course STAT 480 taught by Professor Staff during the Spring '08 term at Pennsylvania State University, University Park.

Page1 / 57

Lecture_7 - Lecture7 MergingDataset Tuesday March 16th...

This preview shows document pages 1 - 12. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online