The term is TRANSPOSE
Transposing data tutorials:
Long to Wide:
https://stats.idre.ucla.edu/sas/modules/how-to-reshape-data-long-to-wide-using-proc-transpose/
https://stats.idre.ucla.edu/sas/modules/reshaping-data-long-to-wide-using-the-data-step/
Wide to Long:
https://stats.idre.ucla.edu/sas/modules/how-to-reshape-data-wide-to-long-using-proc-transpose/
https://stats.idre.ucla.edu/sas/modules/reshaping-data-wide-to-long-using-a-data-step/
@Feyng819 wrote:
My original data look like this:
var1 var2 var3
1 3 C
And I want to make them look like this (splitting one row of data into four rows, var2 goes under var1, the value of var1 shows one row of data with var3 and one row of data without var3)
var1 var2 var3
1 . .
1 . C
3 . .
3 . C
Thank you!!
The term is TRANSPOSE
Transposing data tutorials:
Long to Wide:
https://stats.idre.ucla.edu/sas/modules/how-to-reshape-data-long-to-wide-using-proc-transpose/
https://stats.idre.ucla.edu/sas/modules/reshaping-data-long-to-wide-using-the-data-step/
Wide to Long:
https://stats.idre.ucla.edu/sas/modules/how-to-reshape-data-wide-to-long-using-proc-transpose/
https://stats.idre.ucla.edu/sas/modules/reshaping-data-wide-to-long-using-a-data-step/
@Feyng819 wrote:
My original data look like this:
var1 var2 var3
1 3 C
And I want to make them look like this (splitting one row of data into four rows, var2 goes under var1, the value of var1 shows one row of data with var3 and one row of data without var3)
var1 var2 var3
1 . .
1 . C
3 . .
3 . C
Thank you!!
@Feyng819 wrote:
Im not sure if I am using the transpose correctly
Show your code if you're not sure if your code is correct.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.