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.
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.