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   <statalist@hsphsun2.harvard.edu>
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 www.stata.com.

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

Hope this helps
Svend

__________________________________________

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
Email: sj@soci.au.dk
__________________________________________ 


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

TEMPORARY.
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:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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