First I need to explain what I mean by an "in-text table". This is a sort
of clinical term. It means a table in the body of a descriptive document
and because of this it needs to fit in with the style of the document in
that descriptive part. Plain text SAS tables are not pretty enough to go
in that section but you can use ODS to make tables look prettier, so long
as the output was produced using a sas procedure such as "proc report"
or "proc tabulate". I wrote a page on this here.
However, for me, SAS never makes it pretty enough and I think it is better
to give full control to a word processor by supplying it with a table in
the form that it can convert itself. If you use data _null_ reporting,
then the method described below is probably your best option for producing
in-text tables.
Why you should be able to generate in-text tables
You should aim at being able to generate in-text tables using your standard
reporting software. I will explain why. In a medical document that contains
in-text tables, then if your software is not capable of producing these
tables then the "clinical writer" will often create their own tables in
the word processor's own format and fill in the rows and columns with values
they have copied from your plain-text tables. This is prone to transcription
error. Also, by combining values from tables in this way, things such as
combined counts and the resulting percentages can give a biased appearance
about the drug you are trying to get to market. But if your reporting software
can
produce these in-text tables in a direct or a more direct manner then this
problem can be avoided. The in-text table could then be a pre-defined table
whose design is agreed upon such that any possible bias can be avoided
and you can write the code to produce this table. Done in this way then
the clinical writer no longer "thinks up" tables to put in the descriptive
part of a document but rather has a table produced for them that was agreed
upon in advance.
Converting cells to tables
If you include text in a Word document where you have values separated
by a delimiter such as a semi-colon, then converting this text into a table
is easy. You just highlight it and ask the document to convert it to a
table. This is the method I prefer over using ODS as it gives more control
to the document. Once it has been converted to a table, then changing the
style and font type and size is easy.
An example
I have a reporting macro called %unistats that can produce cells with values
that are suitable to be copied into MS Word documents and converted to
a Word table. You can see how I have done this by linking to the Word document
below. Note the cell values on one of the pages. I then copy and paste
these into the word processor and convert it to an "in-text" table using
the pull-down menu. I had to add the top header line in the final in-text
table you can see at the end..
intext_table_demo.doc
Here is the same Word-style table on its own with an extra p-values
column plus a title and footnotes. I think you'll agree it looks good and
tables such as these look much better in the "in-text" part of a document.
intext_pvalues.doc