Hi All,
I never worked on a Dynamic Summary Table. Can anyone help me with some example code/reference/suggestion on how to produce a Summary table like this:
Significant variables | ||||||
Age | Number of Patients (%) | p value | Unadjusted odds ratio | 95% Confidence interval | ||
65 | 92 (30.5) | p<.01 | ||||
65-75 | 65 (45.4) | 0.25-0.48 | ||||
75-84 | 45 (41) | |||||
85+ | 30 (23.8) | |||||
No. of Visit | ||||||
1 | ||||||
2 | ||||||
3 | ||||||
4 or more | ||||||
mean (standard deviation) | ||||||
median (range) | ||||||
Diagnosis | ||||||
Breast Cancer | ||||||
Lung cancer | ||||||
Cancer of the pancreas | ||||||
Congestive heart failure | ||||||
Copd | ||||||
Cancer of the cervix | ||||||
Others | ||||||
Admission | ||||||
Yes | ||||||
No | ||||||
Day of Visit | ||||||
Monday | ||||||
Tuesday | ||||||
Wednesday | ||||||
Thursday | ||||||
Friday | ||||||
Saturday | ||||||
Sunday |
Several procs will give you results similar to that.
I would start with proc freq or proc univiriate.
Personally I like univariate because you can output the results and then print them in a convenient way.
Curious, did you design that output? Are you converting it from some report, or what you up to?
Thanks,
M
Thanks for your help. Yes I just designed that output the way I want in an excel spreadsheet. I just don't know how to get that output from my data. Your suggestion would be a good place to start with.
When I want to convert my Excel reports to a SAS proc I use proc report. It is kind of old school and has a little bit of steep learning curve, but I found it really useful.
Proc report with a custom format (through proc format) can do 90% of the things you have on that report.
For the confidence interval you might have to use a stats proc like univariate or freq.
Google proc report examples and see if that suits your report needs.
Here a paper that seems like a tood start: Proc Report beyond the Basics
Good luck!
Hi MiguelMaldonado,
I actually want to import excel dataset to sas, analyse the data in SAS, and output in pdf or in other format which will look like what I posted.
Thanks,
That's a bunch of different steps just a quick outline below. It can be broken down further as well.
1. Import data and verify data is imported correctly - e.g. numeric variables are numeric and chars are chars
2. Format the data for the analysis required
3. Running analysis for variables to determine results required
4. Converting code from step 3 into macro
5. Running a macro
Where are you in the process?
Including a p-value indicates some sort of statistical test is to be performed. What do want to test? Compared to what population?
It looks like you'll need a macro - I'm assuming you're running a univariate logistic regression since you state unadjusted odds ratio -though you could obtain that from proc freq as well.
Search Lexjansen.com for clinical reporting macros and you should find something pretty close. A lot of it depends on how your data is structured and what you want as reference variables and such.
Also, what does dynamic refer to here? I'm not sure this belongs in Data Mining but ODS reporting instead.
Hi Reeza,
I am not quite sure if I should call it 'dynamic'... I just thought this type of report is called 'dynamic summary report'....may be I am wrong!
proc sql + proc transpose to do such table/listing .
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!
Use this tutorial as a handy guide to weigh the pros and cons of these commonly used machine learning algorithms.
Find more tutorials on the SAS Users YouTube channel.