BookmarkSubscribeRSS Feed
kumarK
Quartz | Level 8

Hi Please suggest some logic.

I have a data set like customer name and month wise count. (In starting third month they have introduced one scheme i want to find out whether the scheme is impacting the next month counts i.e is there are any decrease or increase in mar apr month counts. I want to highlight those records.)

Dataset:

Custname Jan Feb Mar Apr

pvr 15 20 5 4

adlabs 20 30 40 50

imax 15 25 5 4

cinemax 29 35 7 6

;

;

;

like this i have one lakh customers and four months count.

I want to see based on Jan Feb count is there any trend in Mar Apr.

Suppose lets take PVR Jan feb it has increase but in march, apr it has decreased same as cinemax. Adlabs is increasing like that.

I want to highlight those customers. Any thoughts/logic. TIA

5 REPLIES 5
stat_sas
Ammonite | Level 13

Hi,

Couple of things.

Only two months data would not be sufficient for a trend analysis. In order to highlight customers with increase/decrease counts just identify a logic like if sum of counts in Mar, Apr is greater than sum of counts in Jan, Feb then it would be considered as an increase otherwise a decrease. Without having such a logic it is hard to suggest a solution.

Reeza
Super User

Data is too aggregated to suggest much as indicated above. 

Do you have data at a different level, i.e. weekly, daily?

kumarK
Quartz | Level 8

Hi Reeza,

Thanks for reply. The data is customer wise monthly count. How can we get trends in sas.

Reeza
Super User

OK...its not a matter of trends in SAS its a matter of practice. 

The issue is that with only 4 data points the reliability of such an analysis is questionable.

For example:

Say, I have stock A and then look at the next two months.

Let's assume the probability of increase is 50/50.

So if I see it increase it the next 20 months the odds of that occurring was 0.5*0.5 = 1/4

If I see it decrease the odds were 1/4

To see it decrease one month/increase another month the odds are 50%. 

Because the odds are so high its hard to conclude anything from the data.

Hopefully that explains why you shouldn't do it.

Here's how you'd actually do it, because that's the actual question. This will give you the differences from months to month.

Then you need to decide what's a significant difference. Is it 1, if it changes from 5 to 4? Is it still 1 if it changes from 100 to 99?  Perhaps you should look at percent difference from month to month instead?

If you're testing a particular scheme implementation as initially requested you hopefully have a control group. This would mean some companies were exposed to the scheme and others not so you can try and tease out the actual effect. Then perhaps you want to group the categories together in some manner to see if the change is consistent across industries, i.e. if you can group companies by subject area such as: entertainment, health care or even products, experiences.  That might give you a way to find outliers, companies that don't perform the same as others in a group or groups that are affected by the scheme and others that aren't.

Hope this helps you get started.

data want;

set have;

array mths(4) Jan Feb Mar Apr;

array diff(3) Chg_feb chg_mar chg_apr;

do i=1 to 3;

diff(i)=mths(i+1)-mths(i);

end;

run;

kumarK
Quartz | Level 8

Reeza,

Thanks for detailed explanation. Smiley Happy

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 935 views
  • 5 likes
  • 3 in conversation