Data step & Proc report or something else?

Reply
Frequent Contributor
Posts: 131

Data step & Proc report or something else?

Hello:

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!

Grand Advisor
Posts: 17,332

Re: Data step & Proc report or something else?

I think you're in roll your own territory here.

Esteemed Advisor
Esteemed Advisor
Posts: 7,203

Re: Data step & Proc report or something else?

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.

Frequent Contributor
Posts: 131

Re: Data step & Proc report or something else?

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 ;

run;

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?

Grand Advisor
Posts: 17,332

Re: Data step & Proc report or something else?

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. 

Respected Advisor
Posts: 3,775

Re: Data step & Proc report or something else?

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.

Ask a Question
Discussion stats
  • 5 replies
  • 206 views
  • 6 likes
  • 4 in conversation