• Save
Visualizing Proc Transpose
Upcoming SlideShare
Loading in...5
×
 

Visualizing Proc Transpose

on

  • 922 views

A non-technical explanation of how SAS PROC TRANSPOSE works.

A non-technical explanation of how SAS PROC TRANSPOSE works.

Statistics

Views

Total Views
922
Views on SlideShare
918
Embed Views
4

Actions

Likes
0
Downloads
0
Comments
0

3 Embeds 4

http://www.linkedin.com 2
http://www.lmodules.com 1
https://www.linkedin.com 1

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Visualizing Proc Transpose Visualizing Proc Transpose Presentation Transcript

    • Visualizing PROC TRANSPOSE! An Introduction
    • How do I know I need to Transpose?
      • It’d sure be a lot easier if these observations were next to each other
        • The UP Transpose
      • It’d sure be a lot easier if these variables were observations one underneath each other
        • The DOWN Transpose
    • Four Questions About Your Transpose
      • What should stay the same?
      • What goes up?
      • What goes down?
      • What goes into the middle?
      BY ID VAR VAR
    • On Base Percentage OBP = H+BB+HBP AB+BB+HBP+SF
    • The Data – Calculate H+BB+HBP/AB+BB+HBP+SF 2 6 SF Nick Markakis Orioles 491 637 AB Nick Markakis Orioles 3 5 HBP Nick Markakis Orioles 43 61 BB Nick Markakis Orioles 143 191 H Nick Markakis Orioles 2 2 SF Kevin Millar Orioles 430 476 AB Kevin Millar Orioles 12 8 HBP Kevin Millar Orioles 59 76 BB Kevin Millar Orioles 117 121 H Kevin Millar Orioles Value2006 Value2007 Stat Player Team
    • 1. What should stay the same? The BY Statement PROC TRANSPOSE DATA =Base_stats OUT =tran_stats; BY team player;
    • 1. What should stay the same? Visualization Nick Markakis Orioles Nick Markakis Orioles Nick Markakis Orioles Nick Markakis Orioles Nick Markakis Orioles Kevin Millar Orioles Kevin Millar Orioles Kevin Millar Orioles Kevin Millar Orioles Kevin Millar Orioles Player Team 2 6 SF 491 637 AB 3 5 HBP 43 61 BB 143 191 H 2 2 SF 430 476 AB 12 8 HBP 59 76 BB 117 121 H Value2006 Value2007 Stat
    • 2. What goes up? The ID Statement
      • Up Movement creates VARIABLES from unique VALUES of the ID variable
      PROC TRANSPOSE DATA =Base_stats OUT =tran_stats; BY team player; ID stats;
    • 2. What goes up? Visualization H H BB HBP AB SF HBP BB AB SF Nick Markakis Orioles Nick Markakis Orioles Nick Markakis Orioles Nick Markakis Orioles Nick Markakis Orioles Kevin Millar Orioles Kevin Millar Orioles Kevin Millar Orioles Kevin Millar Orioles Kevin Millar Orioles Player Team Stat
    • 3. What goes down? The VAR Statement
      • Individual variable NAMES are turned into VALUES of a new variable (_NAME_)
      PROC TRANSPOSE DATA =Base_stats OUT =tran_stats; BY team player; ID stats; VAR value2007 value2006; RUN ;
    • 3. What goes down? Visualization Value2007 Value2006 Value2007 Value2006 HBP BB AB Nick Markakis Orioles Nick Markakis Orioles Kevin Millar Orioles Kevin Millar Orioles SF H _NAME_ Player Team 2 6 491 637 3 5 43 61 143 191 2 2 430 476 12 8 59 76 117 121
    • 4. What goes into the middle? The VAR Statement
      • The VALUES of value2006, value2007 are pushed into the newly created variables (H,BB,HBP,AB,SF)
      PROC TRANSPOSE DATA =Base_stats OUT =tran_stats; BY team player; ID stats; VAR value2007 value2006; RUN ;
    • 4. What goes into the middle? Visualization Value2006 Value2006 121 76 8 476 2 191 61 5 637 6 117 59 12 430 2 143 43 3 491 2 Value2007 Value2007 HBP BB AB Nick Markakis Orioles Nick Markakis Orioles Kevin Millar Orioles Kevin Millar Orioles SF H _NAME_ Player Team
    • Finished Product – Calculate H+BB+HBP/AB+BB+HBP+SF 2 6 2 2 SF 3 5 12 8 HBP 43 61 59 76 BB 491 637 430 476 AB 143 Value2006 Nick Markakis Orioles 191 Value2007 Nick Markakis Orioles 117 Value2006 Kevin Millar Orioles 121 Value2007 Kevin Millar Orioles H _NAME_ Player Team .351 .362 .374 .365 OBP
    • Questions?? Contact us at: [email_address]