際際滷

際際滷Share a Scribd company logo
Visualizing PROC TRANSPOSE! An Introduction
How do I know I need to Transpose? Itd sure be a lot easier if these observations were next to each other The UP Transpose Itd 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]

More Related Content

What's hot (20)

Sas cheat
Sas cheatSas cheat
Sas cheat
imaduddin91
SAS Proc SQL
SAS Proc SQLSAS Proc SQL
SAS Proc SQL
guest2160992
SAS Functions
SAS FunctionsSAS Functions
SAS Functions
guest2160992
Sas Functions INDEX / INDEXC / INDEXW
Sas Functions INDEX / INDEXC / INDEXWSas Functions INDEX / INDEXC / INDEXW
Sas Functions INDEX / INDEXC / INDEXW
THARUN PORANDLA
SAS - overview of SAS
SAS - overview of SASSAS - overview of SAS
SAS - overview of SAS
Vibrant Technologies & Computers
SAS Macros part 1
SAS Macros part 1SAS Macros part 1
SAS Macros part 1
venkatam
Sas Plots Graphs
Sas Plots GraphsSas Plots Graphs
Sas Plots Graphs
guest2160992
Concept of Structured Query Language (SQL) in SQL server as well as MySql. BB...
Concept of Structured Query Language (SQL) in SQL server as well as MySql. BB...Concept of Structured Query Language (SQL) in SQL server as well as MySql. BB...
Concept of Structured Query Language (SQL) in SQL server as well as MySql. BB...
Rohan Byanjankar
SAS Clinical Online Training
SAS Clinical Online TrainingSAS Clinical Online Training
SAS Clinical Online Training
Manga SubbuNaidu
Introduction to sas
Introduction to sasIntroduction to sas
Introduction to sas
Ajay Ohri
SAS BASICS
SAS BASICSSAS BASICS
SAS BASICS
Bhuwanesh Rawat
Base SAS Statistics Procedures
Base SAS Statistics ProceduresBase SAS Statistics Procedures
Base SAS Statistics Procedures
guest2160992
CDISC SDTM Domain Presentation
CDISC SDTM Domain PresentationCDISC SDTM Domain Presentation
CDISC SDTM Domain Presentation
Ankur Sharma
Report procedure
Report procedureReport procedure
Report procedure
MaanasaS
Where Vs If Statement
Where Vs If StatementWhere Vs If Statement
Where Vs If Statement
Sunil Gupta
SAS Macro
SAS MacroSAS Macro
SAS Macro
Sonal Shrivastav
Introduction to SAS
Introduction to SASIntroduction to SAS
Introduction to SAS
izahn
A Roadmap for SAS Programmers to Clinical Statistical Programming
A Roadmap for SAS Programmers to Clinical Statistical ProgrammingA Roadmap for SAS Programmers to Clinical Statistical Programming
A Roadmap for SAS Programmers to Clinical Statistical Programming
Mohammad Majharul Alam
Sas
SasSas
Sas
Luckshay Batra
Introduction to clinical sas programming
Introduction to clinical sas programmingIntroduction to clinical sas programming
Introduction to clinical sas programming
ray4hz
Sas Functions INDEX / INDEXC / INDEXW
Sas Functions INDEX / INDEXC / INDEXWSas Functions INDEX / INDEXC / INDEXW
Sas Functions INDEX / INDEXC / INDEXW
THARUN PORANDLA
SAS Macros part 1
SAS Macros part 1SAS Macros part 1
SAS Macros part 1
venkatam
Sas Plots Graphs
Sas Plots GraphsSas Plots Graphs
Sas Plots Graphs
guest2160992
Concept of Structured Query Language (SQL) in SQL server as well as MySql. BB...
Concept of Structured Query Language (SQL) in SQL server as well as MySql. BB...Concept of Structured Query Language (SQL) in SQL server as well as MySql. BB...
Concept of Structured Query Language (SQL) in SQL server as well as MySql. BB...
Rohan Byanjankar
SAS Clinical Online Training
SAS Clinical Online TrainingSAS Clinical Online Training
SAS Clinical Online Training
Manga SubbuNaidu
Introduction to sas
Introduction to sasIntroduction to sas
Introduction to sas
Ajay Ohri
Base SAS Statistics Procedures
Base SAS Statistics ProceduresBase SAS Statistics Procedures
Base SAS Statistics Procedures
guest2160992
CDISC SDTM Domain Presentation
CDISC SDTM Domain PresentationCDISC SDTM Domain Presentation
CDISC SDTM Domain Presentation
Ankur Sharma
Report procedure
Report procedureReport procedure
Report procedure
MaanasaS
Where Vs If Statement
Where Vs If StatementWhere Vs If Statement
Where Vs If Statement
Sunil Gupta
Introduction to SAS
Introduction to SASIntroduction to SAS
Introduction to SAS
izahn
A Roadmap for SAS Programmers to Clinical Statistical Programming
A Roadmap for SAS Programmers to Clinical Statistical ProgrammingA Roadmap for SAS Programmers to Clinical Statistical Programming
A Roadmap for SAS Programmers to Clinical Statistical Programming
Mohammad Majharul Alam
Introduction to clinical sas programming
Introduction to clinical sas programmingIntroduction to clinical sas programming
Introduction to clinical sas programming
ray4hz

Viewers also liked (10)

Put Down That Mouse
Put Down That MousePut Down That Mouse
Put Down That Mouse
Daniel Boisvert
Virtualize your opera/ons and gain the power to shrink your carbon footprint ...
Virtualize your opera/ons and gain the power to shrink your carbon footprint ...Virtualize your opera/ons and gain the power to shrink your carbon footprint ...
Virtualize your opera/ons and gain the power to shrink your carbon footprint ...
Events by Design, Inc.
Microfranqueado SP ClickMicrofranqueado SP Click
Microfranqueado SP Click
Inovarcom Marketing Digital
Nursing informatics ppt (3)
Nursing informatics ppt (3)Nursing informatics ppt (3)
Nursing informatics ppt (3)
Anne Auta
犢犖犖幡犖園犖幡顕犖犖迦牽犖犖謹犖犖4
犢犖犖幡犖園犖幡顕犖犖迦牽犖犖謹犖犖4犢犖犖幡犖園犖幡顕犖犖迦牽犖犖謹犖犖4
犢犖犖幡犖園犖幡顕犖犖迦牽犖犖謹犖犖4
Prachyanun Nilsook
PHP Developer
PHP DeveloperPHP Developer
PHP Developer
NITIN Sawake
亞舒亳从
亞舒亳从亞舒亳从
亞舒亳从
vaheanush
奸嫋侫嫂妍 妍媾奸娑奸娟婬奸婉
奸嫋侫嫂妍   妍媾奸娑奸娟婬奸婉奸嫋侫嫂妍   妍媾奸娑奸娟婬奸婉
奸嫋侫嫂妍 妍媾奸娑奸娟婬奸婉
vaheanush
Virtualize your opera/ons and gain the power to shrink your carbon footprint ...
Virtualize your opera/ons and gain the power to shrink your carbon footprint ...Virtualize your opera/ons and gain the power to shrink your carbon footprint ...
Virtualize your opera/ons and gain the power to shrink your carbon footprint ...
Events by Design, Inc.
Microfranqueado SP ClickMicrofranqueado SP Click
Microfranqueado SP Click
Inovarcom Marketing Digital
Nursing informatics ppt (3)
Nursing informatics ppt (3)Nursing informatics ppt (3)
Nursing informatics ppt (3)
Anne Auta
犢犖犖幡犖園犖幡顕犖犖迦牽犖犖謹犖犖4
犢犖犖幡犖園犖幡顕犖犖迦牽犖犖謹犖犖4犢犖犖幡犖園犖幡顕犖犖迦牽犖犖謹犖犖4
犢犖犖幡犖園犖幡顕犖犖迦牽犖犖謹犖犖4
Prachyanun Nilsook
亞舒亳从
亞舒亳从亞舒亳从
亞舒亳从
vaheanush
奸嫋侫嫂妍 妍媾奸娑奸娟婬奸婉
奸嫋侫嫂妍   妍媾奸娑奸娟婬奸婉奸嫋侫嫂妍   妍媾奸娑奸娟婬奸婉
奸嫋侫嫂妍 妍媾奸娑奸娟婬奸婉
vaheanush

Visualizing Proc Transpose

  • 1. Visualizing PROC TRANSPOSE! An Introduction
  • 2. How do I know I need to Transpose? Itd sure be a lot easier if these observations were next to each other The UP Transpose Itd sure be a lot easier if these variables were observations one underneath each other The DOWN Transpose
  • 3. 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
  • 4. On Base Percentage OBP = H+BB+HBP AB+BB+HBP+SF
  • 5. 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
  • 6. 1. What should stay the same? The BY Statement PROC TRANSPOSE DATA =Base_stats OUT =tran_stats; BY team player;
  • 7. 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
  • 8. 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;
  • 9. 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
  • 10. 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 ;
  • 11. 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
  • 12. 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 ;
  • 13. 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
  • 14. 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
  • 15. Questions?? Contact us at: [email_address]