BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hello ,

I have a monthly data divided into four week period.I wnat to produce the summary stats that contains the information on the no. of units sold of two kinds of LaptopModels FOR EACH WEEK.

I used code -

PROC FREQ Data = sales;
TABLES LaptopModel * UnitsSold ;
RUN;

where the data sles is the data merged for the two periods time (1/11/2009 – 14/11/2009) & (15/11/2009 – 28/11/2009). This code gives me the no. sold over entire month , but I want to have a braekdown for every week of the month.

Table of LaptopModel by UnitsSold

LaptopModel UnitsSold

Frequency|
Percent |
Row Pct |
Col Pct | 1| 2| 5| Total
---------+--------+--------+--------+
AP3965 | 276 | 29 | 7 | 312
| 64.94 | 6.82 | 1.65 | 73.41
| 88.46 | 9.29 | 2.24 |
| 73.60 | 76.32 | 58.33 |
---------+--------+--------+--------+
AT3600 | 99 | 9 | 5 | 113
| 23.29 | 2.12 | 1.18 | 26.59
| 87.61 | 7.96 | 4.42 |
| 26.40 | 23.68 | 41.67 |
---------+--------+--------+--------+
Total 375 38 12 425


Kindly guide.

Regards ,
markc
2 REPLIES 2
Paige
Quartz | Level 8
If there is a variable in the data set that contains the week, then all you need to do is sort by week and then add BY WEEK; into your PROC FREQ code.
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
A prior post / reply recommended you consider SAS techniques (function like INTNX) to derive a start-of-week variable from which you can generate this type of analysis. With the new week-start variable, you can app

Another pair of functions would be to use the YEAR and WEEK functions to extract these two components from a date-variable to use with your analysis.

Scott Barry
SBBWorks, Inc.

http://support.sas.com/forums/message.jspa?messageID=32184

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is ANOVA?

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.

Discussion stats
  • 2 replies
  • 1406 views
  • 0 likes
  • 3 in conversation