Statalist The Stata Listserver

[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: SPSS-like tables in STATA?

From   "Svend Juul" <SJ@SOCI.AU.DK>
To   <>
Subject   Re: st: SPSS-like tables in STATA?
Date   Fri, 30 Mar 2007 14:41:39 +0200

Bachrain wrote: 

Quite a newbie in Stata I try to get simple frequency tables like 
the ones in spss, i. d. frequencies - percent - cumulative percent
 - valid percent -  valid cumulative percent.

I'm using Stata 8.2. I thought the ados groups.ado and xcontract.ado
could help. But I don't get the result I want to have - just some
simple frequency tables. What's the easiest way to produce such
tables. Do I miss something?

I think you miss an introductory Stata book; take a look in Stata's
bookstore at

In the meantime: Here is a short list of some SPSS commands,
together with their Stata counterpart. -tab1- corresponds exactly

Hope this helps


Svend Juul
Institut for Folkesundhed, Afdeling for Epidemiologi
(Institute of Public Health, Department of Epidemiology)
Vennelyst Boulevard 6
DK-8000  Aarhus C, Denmark
Phone: +45 8942 6090
Home:  +45 8693 7796

SPSS command                      Similar Stata command
------------                      ---------------------
DATA LIST	                      infile; infix; insheet

GET FILE	                      use

SAVE OUTFILE	                save

VARIABLE LABELS	                label variable

VALUE LABELS	                label define     followed by
                                  label values

FORMAT sex (F1.0).	          format sex %1.0f

MISSING VALUES	                Missing values are special

COMMENT; *	                      * or //

DOCUMENT	                      note

DISPLAY DICTIONARY	          describe; codebook

COMPUTE	                      generate; replace; egen

IF (sex=1) y=2.	                generate y=2 if sex==1

RECODE a (5 thru 9=5) INTO agr.   recode a (5/9=5) , generate(agr)

DO REPEAT ... END REPEAT	    for; foreach; forvalues

SELECT IF	                      keep if; drop if

SELECT IF (sex=1).	          <command> if sex==1

SAMPLE 0.1.                       sample 10

SPLIT FILE	                      by...:

WEIGHT	                      Weights can be included in most commands

DESCRIPTIVES	                summarize

FREQUENCIES                       tabulate; tab1

CROSSTABS                         tabulate; tab2

MEANS bmi BY agegrp.              oneway bmi agegrp, tabulate

T-TEST                            ttest

LIST                              list

WRITE	                            outfile; outsheet

SORT CASES BY                     sort

AGGREGATE                         collapse

ADD FILES                         append

MATCH FILES                       merge

*   For searches and help try:

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