04-10-2015 10:12 AM
I've created the following table shell for a table i need to create. Based on the following table shell, would one suggest using a data step and proc report or will only proc report be sufficient?
Previously, when I didn't have to combine mean and standard deviation into one cell, I found proc tabulate helpful in creating this tabular report. I see combining stats in one cell isn't possible, however so have switched to proc report. Some questions I have:
- how does one show both statistics in one cell in proc report?
- how do i include a row of only frequencies for my across variable in proc report? In other words, can I make a variable the "across" variable in proc report as well as define it as an analysis variable and show its frequencies?
Thank you for suggestions!
04-10-2015 10:27 AM
I agree with Reeza, split the report up into columns, and cells, then build it by hand to create a dataset which looks like the output. Then basic proc report.
04-10-2015 12:10 PM
Hi Reeza and RW9:
I used the following proc tabulate code:
proc tabulate data=sample out=tab_estabgroup (drop=_TYPE_ _PAGE_ _TABLE_) ;
class estabgroup ; /*edit covars here*/
var Firm_employee_n ;
table n (Firm_employee_n)*(mean std), estabgroup ALL ;
to create the following table:
But I want to do three things:
1. add a pooled mean column for firm_employee_n, which i did using ALL keyword later
2. combine mean and std into one cell (looks like proc tab can't do this)
3. add a column with p-values from a proc anova test (can i append this column to this table?)
would you have suggestions on doing #3 if not #2 and #3?
04-10-2015 12:30 PM
Same as before, you need to create your own table via code.
You can use the OUT= option from proc tabulate to create a table with the summaries but the format won't be the same as you see in the results pane.
04-10-2015 01:12 PM
Typically you would create a character cell value as combined mean(std) 99.9(55.5) and display that.
I do all that pre-processing in data step and all cell in table are character values of formatted statistics.