- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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:
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
What we need is some representative sample data and desired result. This allows us to provide tested code and it also really helps to better understand what you describe.
Please provide your sample data as below:
data have;
infile datalines truncover dsd;
input Week ProductId Age TotRev Treatment HasVideo Group.;
datalines;
<and here sample data, comma separated>
;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Do you mean a snapshot of my data or just a random sample? Columns are Week, ProductID, Age, TotRev, Treatment, HasVideo, and group. I'm looking to find the difference of TotRev in the years labeled as 'After' in group, deducting those labeled as 'Before' in group categorized by Age.
I provided pictures of data below.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@ccherrub I mean sample data provided via a working SAS data step and not a screenshot so we've got something to work with and test the code we propose.
Use the data step template I've provided already to provide such a SAS data step.