Please suggest to get the output. Thank you
I need to replace mean,medain,cv with '-' if row with 'n' has less than 3.
for param='a', s2 column has 2 for n, so I need to change the mean,median,cv to '-'.
for param='b', s2 and s3 columns have 2 and1, so I need to change the mean,median,cv to '-'.
output needed:
3 2 4 n a
5 - 8 mean a
4 - 5 meadin a
10 - 15 cv a
3 2 1 n b
5 - - mean b
4 - - meadin b
10 - - cv b
data aa;
input s1 $ s2 $ s3 $ r3 $ param $;
datalines;
3 2 4 n a
5 6 8 mean a
4 7 5 meadin a
10 20 15 cv a
3 2 1 n b
5 6 8 mean b
4 7 5 meadin b
10 20 15 cv b
;
Please go back and edit your subject line so that it is descriptive of your problem. There's no point in a subject "Help in my pgm" as almost every question here could have that subject line. The Community is trying to help you, but you have to help the Community.
Please go back and edit your subject line so that it is descriptive of your problem. There's no point in a subject "Help in my pgm" as almost every question here could have that subject line. The Community is trying to help you, but you have to help the Community.
It may be that the time allowed to edit your original post has expired.
Why do you have the data is such a strange layout?
Is PARAM the key variable that let's you link the observations with N to the observations with the MEDIAN?
Why isn't the data organized like this:
data have;
input param $ repeat n mean median cv;
cards;
a 1 3 5 4 10
a 2 2 6 7 20
a 3 4 8 5 15
b 1 3 5 4 10
b 2 2 6 7 20
b 3 1 8 5 15
;
Then the request change is easy;
data want ;
set have;
if N< 3 then call missing(of mean median cv);
run;
Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.
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.
Ready to level-up your skills? Choose your own adventure.