Hi All,
I have a dataset as below:
I need to transpose the data as below subject wise:
Any help ?
Use PROC TRANSPOSE.
proc transpose data=have out=want(drop=_name_) ;
by usubjid;
id vstestcd;
var vsorres;
run;
Note that if you will collect multiple BP readings per subject then you will probably also need to another variable to in the original dataset you can use in the BY statement so that PROC TRANSPOSE knows which pairs of SYS and DIA readings to keep together on the same output observation.
Use PROC TRANSPOSE.
proc transpose data=have out=want(drop=_name_) ;
by usubjid;
id vstestcd;
var vsorres;
run;
Note that if you will collect multiple BP readings per subject then you will probably also need to another variable to in the original dataset you can use in the BY statement so that PROC TRANSPOSE knows which pairs of SYS and DIA readings to keep together on the same output observation.
Thank you so much ! it worked !
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.