Hi! So I have a dataset involving variables Week, ProductID, Age, TotRev, Treatment, HasVideo, and a self-created one: "Group". Each ProductID was tested for weeks and with five different categories. The varible group was made to determine if it was before or after another variable got introduced. I was struggling with how I am able to get a table with a difference of After-Before in TotalRev for each age group primarly. I was also wondering if adding in for each ProductID would be possible. Thank you!
Let me know if more information is needed.
Codes:
libname AEData "~/my_shared_file_links/u47408605/Data"
access=readonly;
run;
Proc Print data=AEData.project2 (obs=20);
run;
Data project2;
set aedata.project2;
if week>25 then group = "After";
else if week<25 then group = "Before";
run;