which proc is suitable to do the task?? can i go with proc tabulate

Reply
Frequent Contributor
Posts: 89

which proc is suitable to do the task?? can i go with proc tabulate

Hai All,

       Now i am in crises to do my assignment.Here i need to get the table like this(Attached image). I dint know which method is suitable for doing the task.

      Anyone help me to do the task.

Thanks

Krishna


Capture1.PNG
Frequent Contributor
Posts: 89

Re: which proc is suitable to do the task?? can i go with proc tabulate

Please help me ..Smiley Sad

Super Contributor
Posts: 490

Re: which proc is suitable to do the task?? can i go with proc tabulate

The image is not very helpful.

Could you give us, image from excel with small literal description?

Frequent Contributor
Posts: 89

Re: which proc is suitable to do the task?? can i go with proc tabulate

hai Mohamed

          Thanks for your reply.

          Here i have a data set with 400 records.I need to get the table (shown in image) . I couldn't find the solution till now.

         My team head asked me to split the data set like(Aged,Sex) then combine last.He need to get the table as shown in image.

      

Capture.PNG

   Age,Sex,race are in single data set variables.I want to arrange the data like this.Any way to find the solution??

Super User
Super User
Posts: 7,720

Re: which proc is suitable to do the task?? can i go with proc tabulate

Hi,

That is a standard demographics table for pharma.  You would need to do some combinations to get that as you have several groupings on the page.  Now you can use any number of methods to get the results - proc means/summary etc. which will all give you the n, mean, median etc.

http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a000146729.htm

You can also proc means the others and just take n.  You would also then need to post process the output datasets from there to get your n (%) etc.

So the process would be:

Sort then means AGE to work.age

Sort then means SEX to work.sex

Sort then means RACE to work.race

Set the above three datasets together creating a new variable for trt1, trt2, total.

In the new variables put the result you want into the format you want, and concatenate " (" and ")" with the result of population count / result * 100.

That's the basic premise.  I am not writing a whole program for you though, I would assume the company you work for would have many examples of this table and its part of TLF programming (a job spec).

Frequent Contributor
Posts: 89

Re: which proc is suitable to do the task?? can i go with proc tabulate

Hai RW9

      Thanks for your reply.Please show me some example

Super User
Super User
Posts: 7,720

Re: which proc is suitable to do the task?? can i go with proc tabulate

Well, that's really my last point there.  Each company holds IP on its own methods of coming to that output.  That is part of a job, not really a specific question.  You need to have a look at what has been done on other studies within your own company, and utilize company standards - e.g. templates, macros etc. 

Frequent Contributor
Posts: 89

Re: which proc is suitable to do the task?? can i go with proc tabulate

heloo here am the only one  person to do the sas task.Am newbie in sas,and have only some basic knowledge.Am not getting any proper training ,going with self learning.

Am not following any standards,first thing is to learn the sas.I need to learn the sas.So kindly requesting you to show the examples

Krishna

Frequent Contributor
Posts: 89

Re: which proc is suitable to do the task?? can i go with proc tabulate

Hi any possible way to merge the two stat values onto same column(separated by comma(,))

Super Contributor
Posts: 490

Re: which proc is suitable to do the task?? can i go with proc tabulate

use any concatenation function

For example:

data xvy;

new= cats(sum(2, 3, 4 ,5),',', mean(1,2,3,2));

run;

Frequent Contributor
Posts: 89

Re: which proc is suitable to do the task?? can i go with proc tabulate

thanks mohamed Smiley Happy

Super Contributor
Posts: 490

Re: which proc is suitable to do the task?? can i go with proc tabulate

Frequent Contributor
Posts: 89

Re: which proc is suitable to do the task?? can i go with proc tabulate

Thanks Mohamed

           

               Is it possible to show some examples??

Occasional Contributor
Posts: 6

Re: which proc is suitable to do the task?? can i go with proc tabulate

Hi,

Here is some code example for sex and race. I suggest you do the same for age statistics by using means procedure.

libname dmg "\\clindb\Phase1\SASinput\demographic";

proc freq data=dmg.dm noprint;

table race*arm/out=dmfreq;

run;

data freqdm;

set dmfreq;

value= compress( count || '('  || compress(round(percent, 0.01)) || '% )'  );

run;

proc transpose data=freqdm out=set1 (drop=_name_);

id Arm   ;

var value;

by race;

run;

data set1;

set set1;

length var1 $ 30.;

array mango(3) Std_drug Drug_a Placebo;

do i=1 to 3 ;

if mango (i)=' ' then mango(i)= '0(0.00% )';

end;

drop i;

var1=race;

drop race;

run;

proc format ;

value $sx 'F'='Female'

'M'='Male';

run;

proc freq data=dmg.dm noprint;

table sex*arm/out=dmfreqsx;

format sex $sx.;

run;

data freqdmsx;

set dmfreqsx;

value= compress( count || '('  || compress(round(percent, 0.01)) || '% )'  );

run;

proc transpose data=freqdmsx out=set1sx (drop=_name_);

id Arm   ;

var value;

by sex;

run;

data set1sx;

length var1 $ 30.;

set set1sx;

array mango(3) Std_drug Drug_a Placebo;

do i=1 to 3 ;

if mango (i)=' ' then mango(i)= '0(0.00% )';

end;

drop i;

var1=sex;

format var1 $sx.;

drop sex;

run;

data report;     

set set1sx set1;

run;

proc report data=report nowd;

columns var1  Std_drug Drug_a Placebo;

run;

Frequent Contributor
Posts: 89

Re: which proc is suitable to do the task?? can i go with proc tabulate

Hai ,

Thanks for the reply..

   

        what is arm??? can i got the same report by using this way?

Thanks

Krishna

Ask a Question
Discussion stats
  • 17 replies
  • 552 views
  • 1 like
  • 4 in conversation