Thursday, September 29, 2011

How do i do this SPSS command in Stata

http://www.ats.ucla.edu/stat/stata/faq/spss_command_to_stata.htm

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 (or similar) command in Stata?  (By the way, there are actually three similar Stata commands, generatereplace 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 CommandStata Command(s)UCLA Web PagesStata ManualBooks
ADD FILESappendCombining data  [D] appendishr - 9.5
AGGREGATEcollapseCollapsing data across observations[D] collapseishr - 9.6
ANOVAanova.[R] anova 
AUTORECODEdestring
encode
How can I quickly convert many string variables to numeric  [D] destring
[D] encode
 
CASESTOVARSreshape wideReshaping data from long to wide[D] reshape 
COMMENT*
/* */
//
.[P] commentsishr 4.8
COMPUTEgenerate
replace
egen
Creating and Recoding Variables[D] generate
[D] replace
[D] egen
ishr 8.1
CORRELATIONScorrelate
pwcorr
Overview of statistical tests in Stata
Annotated output for the correlation command
[R] correlate 
CROSSTABStabulate
tab2
Overview of statistical tests in Stata[R] tabuluate twowayishr 10.3
DATA LISTinfile
infix
insheet
Inputting raw data files into Stata[D] infile (free format)
[D] insheet
[D] infix (fixed format)
ishr 6.3
DELETE VARIABLESkeep
drop
Subsetting variables and observations[D] drop 
DESCRIPTIVESsummarizeDescriptive information and statistics
Annotated output for the summarize command
 
[R] summarizeishr 10.1
DISPLAYdescribe.[D] describe 
DOCUMENTnotes.[D] notes 
DO IFxyzcommand ifStata Learning Module: Using "if" for subsetting with Stata Commands[U] 11.1.3 if exp 
DO REPEATforeachWorking across variables using foreach[P] foreachishr - 17.4
ECHOdisplay.[P] display 
ERASEerase.[D] erase 
EXAMINEtabulate x, summarize(y)Overview of statistical tests in Stata[R] tabulate, summarize() 
EXECUTEno equivalentcomment: transformation commands always immediately executednone 
EXPORTno equivalentcomment: all Stata files can be used on all platformsnone 
FACTORfactorAnnotated output for the factor command[MV] factor 
FILE LABELlabel dataLabeling data, variables and values[D] label 
FILTERxyzcommand if (___)Using "if" for subsetting with Stata Commands[U] 11.1.3 if exp 
FLIPxpose.[D] xpose 
FORMATSformat.[D] formatishr - 5.2
FREQUENCIEStabulateOverview of statistical tests in Stata[R] tabulate onewayishr - 10.3
GET FILEuseUsing and saving Stata data files[D] useishr - 6.1
GET SASfdauseSAS to Stata
SAS w/formats to Stata
[D] fdause 
GRAPHgraphIntroduction to graphics[G] graph 
IFgenerate __ if __Using "if" for subsetting with Stata Commands[U] 11.1.3 if expishr - 8.1
IGRAPHgraphIntroduction to graphics[G] graph 
INCLUDE FILEdo ___.[R] do 
LISTlist.[D] list 
LOGISTIC REGRESSIONlogisticData Analysis Example: Logistic Regression[R] logistic 
LOOPforvalues [P] forvalues 
MATCH FILESmergeCombining Stata data files[D] mergeishr - 9.5
MEANStabulate __, summarize(__)Overview of statistical tests in Stata[R] tabulate, summarize()ishr - 10.4
MISSING VALUESnone.[U] 12.2.1 Missing Values 
MIXEDxtmixed.[XT] xtmixed 
NOMREGmlogitData Analysis Example: Multinomial Logistic Regression[R] mlogit 
PLUMologitData Analysis Example: Ordinal Logistic Regression[R] ologit 
PROBITprobitData Analysis Example: Probit Regression[R] probit 
RECODErecodeCreating and Recoding Variables[D] recodeishr - 8.4
RECORD TYPEno equivalenthttp://www.stata.com/support/faqs/data/hier.html  
REGRESSIONregressRegression with Stata
Annotated output for the regress command
[R] regress 
RELIABILITYalpha.[R] alpha 
RENAME VARIABLESrename.[D] rename 
SAMPLEsample.[D] sampleishr - 9.2
SAVEsaveUsing and saving Stata data files[D] saveishr - 6.1
SELECT IFkeep if
drop if
Subsetting variables and observations[D] dropishr - 9.2
SORT CASESsort.[D] sortishr - 9.4
SPLIT FILEby.[D] by
[U] 11 Language syntax
ishr - 4.7
SUMMARIZEtabulate ___, summarize(___)Overview of statistical tests in Stata[R] tabulate, summarize() 
TEMPORARY.
SELECT IF (___).
xyzcommand if (___)Using "if" for subsetting with Stata Commands[U] 11.1.3 if expishr - 4.4
T-TESTttestOverview of statistical tests in Stata ishr - 10.4
VALUE LABELSlabel valuesLabeling data, variables and values
[D] label
ishr - 7.1
VARIABLE LABELSlabel variableLabeling data, variables and values[D] labelishr - 7.1
VARSTOCASESreshape longReshaping data from wide to long[D] reshape 
WEIGHTaw pw fw iwWhat types of weights do SAS, Stata and SPSS support?[U] l11.1.6 weightishr - 4.5
Legend
  • xyzcommand stands for any arbitrary Stata command
  • UCLA Web Pages
    • "." - no specific page exists. Try visiting the site and using the "search" command to pages that might tangentially refer to the command.
  • Stata Manual Names
    • [D] Data
    • [R] Reference manual
    • [U] Users Guide
    • [MV] Multivariate Statistics
    • [XT] Cross sectional time series
  • Book References
    • ishr - Introduction to Stata for Health Researchers by Svend Juul

No comments:

Post a Comment