BookmarkSubscribeRSS Feed
AKSHAYMOGHE
Calcite | Level 5

s
I have data for credit card customers with their month on month balances ( In columns ) for last 24 month .

This makes my data with 25 column ( 1 card nbr + 24 for balances ).

I want to compute std dev of coumn 1-12 and 13-24 respectively .

Also i want to recompute std dev for columns 1-12 and 13-24 by excluding MAX from each set .

How can i do this ?

2 REPLIES 2
mohamed_zaki
Barite | Level 11

For the first part of your question:

proc transpose data=have out=long;

   by nbr;

run;

data wide;

set long;

format h $ 5.;

by nbr;

retain c;

retain h;

c=c+1;

if first.nbr then do;

  h="1-12";

  c=1;

end;

else if c >= 13 then h="13-24";

run;

proc means data=wide std ;

class nbr h;

var col1 ;

run;

RW9
Diamond | Level 26 RW9
Diamond | Level 26

Yes, as mentioned above you want to normalise your data.  This is a method of taking columns and creating records from them.  The opposite is transposed where records are taken and columns created (which you currently have).  Once you have your normalised table you can do the means as above, then with an extra 2 steps:

proc sort data=xyz;

     by nbr descending col1;

run;

data xyz;

     set xyz;

     by nbr;

     if first.nbr then delete;

run;

proc means...

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

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
  • 1624 views
  • 1 like
  • 3 in conversation