BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Cynthia_sas
SAS Super FREQ

Hi:
  This is a new question and on the 3rd page of a previous posting. This really should be a new question by itself.

 
  As with other suggestions, we need to see sample data in a form that is usable and also need to see the code that you've tried.
You are describing 2 different challenges:
1) how to categorize ages into aggregate categories and get N and % based on the categories
2) how to get summary statistics by treatment (TRT1, TRT2) into the N (%) form you need.

And, my recommendation is that first you generate the numbers you need for the N and the Percent and then you worry about getting the cosmetics straight.

To make the categories you want, assuming that you have rows with individual age values in your data (and no one knows what your data looks like because you haven't posted any data) -- assuming you need to make categories based on an AGE variable, I would recommend a user-defined format.

Cynthia

 

This addresses the 1st challenge:

use_format_collapse_category.png

 

Previous postings have shown that you need to make a dataset from your correct results and then make a character variable that contains your N (%) and use that new data to create your report.

 

sasuser123123
Quartz | Level 8
Of course..I got 2nd point that what you are mentioned above..Yeah,now I've an Idea about first point..so now I have to do create a format with names '<65', '>65' like that ..Am I right what I am saying...!!

And I've used proc freq for getting Count and I did percentages manually..like Percent=trt1/total*100...
Then I concatenate the count with percent


Thank you!
sasuser123123
Quartz | Level 8
And I've doubt ...
I've two variables TRT1,TRT2 those has values like 45(23),55(56) after concatinating count and percentage and I want to add new variable total which should contains total of count and percentage like 100(79)... Can you please tell me how to create
Cynthia_sas
SAS Super FREQ

Hi:

  This  question about 2 treatments has already been asked and answered in this same forum, with an example, as shown below:

sub_1_2.png

 

Once you get THESE numbers in separate cells, either using PROC REPORT, PROC TABULATE or PROC FREQ, then getting the total is very easy. All you have to do is change the above COLUMN statement:

get_tot_cols.png

 

To make a character variable that has the N and percent N cosmetically arranged as you describe -- that will need a COMPUTE block. Once you have the cosmetics settled, you can then use NOPRINT on the DEFINE statements for N and PCTN.

 

Also making a character column is just a matter of using a COMPUTE block. However, because SUB-01 and SUB-02 are across items, you have to make your character column on the report using absolute column names. There have been many previous forum postings on using ACROSS items in a COMPUTE block and using absolute column numbers.

 

Cynthia

sasuser123123
Quartz | Level 8
Thank you Cynthia for your assistance
sasuser123123
Quartz | Level 8

Hello Cynthia!

I'm trying to do SDTM EG domain so that I've a raw data that should be converted to standard SDTM EG format.The format should be the SDTMIG ,we have example in that domain.IMG_20190909_180347294.jpgIMG_20190909_180206477.jpg

Cynthia_sas
SAS Super FREQ

Hi:

  This is NOT at all related to your previous postings or your original question. Please start a new posting for this question. Your screen shot is unreadable.

 

  In your new posting, you'll need to post a better screen shot of your desired output. If you post your input data as a screen shot, no one will be able to help you. As always, we need to see the code you've tried and the data you're using and a good description of the problem and what you need to generate as desired output.

 

  To work with CDISC data, we have the Clinical Standards Toolkit and the XML Mapper. If you are not familiar with those tools, it might be better for you to open a track with Tech Support.

 

Cynthia

sasuser123123
Quartz | Level 8

Ohh Ok. Thank you quick response

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 52 replies
  • 19360 views
  • 3 likes
  • 6 in conversation