Was asked the following question:
1) Reshape the data from long to wide according to the Date variable
(i.e., creating multiple new variables based on Date). Retain ID, LastName, and DOB
on each line, and use the values in Event as the new variable names.
I thought I had it but when I use my code, nothing in the dataset seemed to change? There were still 100 rows like the original dataset
proc transpose data = covidlng.covidlong out = cohortwide prefix = Event;
by id lastname dob;
id event;
var date;
run;
what I see when I hit run
proc contents for OG dataset
proc contents for the cohort wide
Your log and code and everything looks correct. What makes you think it's wrong?
I think SAS Studio only shows you the first 50 or 100 records by default, you need to press a button to see the rest of the records?
What does your LOG look like? Copy the text from the log, open a text box on the forum using the </> icon above the message window and paste the text. Include the program statements and all the notes or messages from that code.
I ran your code on your data set and get 472 records in the output data set, which is the same as you show in the proc contents for the wide set. The original data set has 1416 observations. So I do not see where you are getting 100.
I suspect that perhaps you do not want to use PREFIX=EVENT has that makes the new variable names EVENT+the value of the event variable.
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.