Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Spss vs Stata

From   "Shahrul Mt-Isa" <>
To   <>
Subject   Re: st: Spss vs Stata
Date   Wed, 4 Aug 2010 13:53:10 +0100

I find that it is more time consuming to keep switching programs to build
tables etc. Having a structured table ready for publication is always ideal.
Because normally creating pivot tables for example creating something from a
-tab- output is common, it is best to spend a few hours to write a programme
to do this.

I've written a simple program to build table in .rtf format to give such
tables in an .rtf file (although may need further formatting to make it look
pretty in word). Happy to share. E-mail me if you'd like a copy of this
program as I don't think I can send it as attachment here.

The output looks somewhat like this [% (n)] (xx=masked figures as come from
ongoing study):
	Female	Male
0	xx.92 (xx)	xx.61 (xx)
1	xx.42 (xx)	xx.28 (x)
2	xx.25 (xx)	xx.77 (xx)
3	xx.42 (xx)	xx.51 (xx)

A small tinkering using the same principles, you can achieve something like
below (as a table but might not print properly here):
	com	commis	gps	gpsmis
No randomised	xx		xx	
Males (m/f)	xx.x (xx/xx)	0	xx.x (xx/xx)	0
Age(yrs)		0		0
Mean(sd)	xx.5 (xx.4)		xx.4 (xx.0)	
Med(IQR)	xx.1 (xx.6-xx.0)		xx.7 (xx.0-xx.8)	
Hypertension	xx.0 (xx)	0	xx.7 (xx)	0
Fam hist of diabetes	xx.5 (xx)	0	xx.1 (xx)	0


Shahrul Mt-Isa
Imperial Clinical Trials Unit,
School of Public Health, 
Imperial College London,
Norfolk Place, London W2 1PG.

Date: Tue, 03 Aug 2010 10:27:29 +0200
From: SCHOUMAKER Bruno <>
Subject: Re: st: Spss vs Stata

if I am wrong) only one column variable (but multiple row variables).

Le 2/08/2010 16:43, Neil Shephard a écrit :
> n Mon, Aug 2, 2010 at 2:30 PM, Kaulisch, Marc
> <>  wrote:
>> I am more concerned about the flexibility to generate pivot tables than
about pretty tables.
> I've no idea what a "pivot table" is, but if the structure below....
>> My previous example in was:
>> Table
>> Rowvar  colvar1 colvar2
>>                 1       2       1       2       3
>>                 n C%    n C%    n C%    n C%    n C%
>> 1
>> 2
>> 3
>> Total
>> In order to avoid weeks of Stata programming etc. we decided to generate
those tables in SPSS.
> You could likely achieve it using Ian Watson's -tabout- (available on
> SSC) or likely achieve it from first principles using
> -contract-/-collapse- in conjunction with some -append-/-merge- and a
> small amount of programming.
> Although of course I've assumed that you know how to do this sort of
> programming, and if not it may well take "weeks", but next time it
> will take you far less, and eventually it will become second nature if
> you use Stata regularly.
> Neil

- -- 

Centre de recherche en démographie et sociétés
Université catholique de Louvain
1-17 PLace Montesquieu
1348 Louvain-la-Neuve

Tel. +32 10 474136
Fax. +32 10 472952

*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index