You are on page 1of 4

By

Shahzad Asghar Arain


Mphil,SCJP,OCP
http:/www.pakdata.net

How do we do this SPSS command in Stata?

In public health research mostly datasets analyzed by SPSS especially in Pakistan.


But now day’s public health experts love to use STATA. This article may help you if
you have command in SPSS and want to start work in STATA.

Say that you use SPSS but wish to know how to do a particular command in Stata. For
example, you want to make a new variable and know you can use the compute command
to create a new variable in SPSS, but what is the equivalent command in Stata? There are
actually three similar Stata commands, generate, replace and egen). The table below
shows you five columns of information.

• SPSS commands, listed in alphabetical order


• The equivalent (or similar) Stata command(s)
• Links to UCLA web pages that illustrate the use of the Stata command
• Cross references to the Stata manual for learning more about the command (which
is also hot linked to the online help for the command)
• Cross references to books that illustrate more about the command.

This table is by no means complete, and it not intended to be a complete and exhaustive
reference. Instead, it is intended to be a short, simple, sweet and handy reference for
SPSS users who are making the transition to Stata. We also highly recommend A Sample
Stata Session (via the Stata web site) which gives you a quick overview of using Stata as
well as seeing the [GS] Getting Started manual that accompanied your purchase of Stata.

SPSS Command Stata Command(s)


ADD FILES Append
AGGREGATE collapse
ANOVA anova
destring
AUTORECODE
encode
CASESTOVARS reshape wide
*
COMMENT /* */
//
generate
COMPUTE replace
egen
correlate
CORRELATIONS
pwcorr
tabulate
CROSSTABS
tab2
infile
DATA LIST infix
insheet
DELETE keep
VARIABLES drop
DESCRIPTIVES summarize
DISPLAY describe
DOCUMENT notes
DO IF xyzcommand if
DO REPEAT foreach
ECHO display
ERASE erase
EXAMINE tabulate x, summarize(y)
EXECUTE no equivalent
EXPORT no equivalent
FACTOR factor
FILE LABEL label data
FILTER xyzcommand if (___)
FLIP xpose
FORMATS format
FREQUENCIES tabulate
GET FILE use
GET SAS fdause
GRAPH graph
IF generate __ if __

IGRAPH graph
INCLUDE FILE do ___
LIST list
LOGISTIC
logistic
REGRESSION
LOOP forvalues
MATCH FILES merge
MEANS tabulate __, summarize(__)
MISSING
none
VALUES
MIXED xtmixed
NOMREG mlogit
PLUM ologit
PROBIT probit
RECODE recode
RECORD TYPE no equivalent
REGRESSION regress
RELIABILITY alpha
RENAME
rename
VARIABLES
SAMPLE sample
SAVE save
keep if
SELECT IF
drop if
SORT CASES sort
SPLIT FILE by
SUMMARIZE tabulate ___, summarize(___)
TEMPORARY.
xyzcommand if (___)
SELECT IF (___).
T-TEST ttest
VALUE LABELS
VARIABLE
LABELS
VARSTOCASES
WEIGHT

My comments
I have both Stata and SPSS on my computer. In my opinion, SPSS has only
two slight advantages and many, many disadvantages. The two advantages
are that it is slightly more user friendly in making complex tables and graphs
The bottom line is that SPSS doesn't do much, although it is (perhaps too)
easy to use. For example, it's useful multivariate analysis procedures are
pretty much limited to OLS, probit, and logit, with a few less useful additional
procedures avialable. SPSS does not have the multiple pooled cross sectional
time series routines that Stata has. There are no count procedures (Poisson,
negative binomial and the zero routines), and other maximum likelihood
estimators such as Tobit, multinomial logit, ordinal logit or probit, and
complementary log-log models are not readily available.

Additional problems with SPSS include no Huber-White correction for


heteroskedascity, and none of Stata's extensive tests that are available after
estimation. The anova routines in SPSS are not nearly as comprehensive as
those in Stata. The last time I looked at SPSS there weren't any provisions
for Cox regression and the other extensive duration analysis procedures that
Stata offers. In short, anyone who limits themselves to SPSS would be quite
handicapped.

Regards
Shahzad Arain
Islamabad-Pakistan
Shahzad.cdcu@gmail.com

You might also like