How can I perform this SPSS command in Stata?

How can I perform this SPSS command in Stata?

The process of executing an SPSS command in Stata involves converting the syntax of the SPSS command into Stata’s language, followed by running the converted command in the Stata program. This allows users to perform the same function or analysis in Stata as they would in SPSS, using the appropriate Stata syntax. This method enables users to utilize the features and capabilities of both software programs and achieve consistent results.

How do I do this SPSS command in Stata? | Stata FAQ

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,
generate
, replace and egen). The table below shows you five
columns of information.

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 FILESappend

Combining data
 

[D] appendishr – 9.5
AGGREGATEcollapse

Collapsing 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 wide

Reshaping 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]
tabulate twoway
ishr 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 
DESCRIPTIVESsummarize– Descriptive 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 SASfdause– SAS to Stata
– SAS w/formats to
Stata
[D] fdause 
GRAPHgraph Introduction to graphics[G] graph 
IFgenerate __ if __Using “if” for subsetting
with Stata Commands
[U] 11.1.3 if expishr – 8.1
IGRAPHgraph Introduction 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 equivalent http://www.stata.com/support/faqs/data/hier.html  
REGRESSIONregress– Regression 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
weight
ishr – 4.5

Legend

Cite this article

stats writer (2024). How can I perform this SPSS command in Stata?. PSYCHOLOGICAL SCALES. Retrieved from https://scales.arabpsychology.com/stats/how-can-i-perform-this-spss-command-in-stata/

stats writer. "How can I perform this SPSS command in Stata?." PSYCHOLOGICAL SCALES, 1 Jul. 2024, https://scales.arabpsychology.com/stats/how-can-i-perform-this-spss-command-in-stata/.

stats writer. "How can I perform this SPSS command in Stata?." PSYCHOLOGICAL SCALES, 2024. https://scales.arabpsychology.com/stats/how-can-i-perform-this-spss-command-in-stata/.

stats writer (2024) 'How can I perform this SPSS command in Stata?', PSYCHOLOGICAL SCALES. Available at: https://scales.arabpsychology.com/stats/how-can-i-perform-this-spss-command-in-stata/.

[1] stats writer, "How can I perform this SPSS command in Stata?," PSYCHOLOGICAL SCALES, vol. X, no. Y, ص Z-Z, July, 2024.

stats writer. How can I perform this SPSS command in Stata?. PSYCHOLOGICAL SCALES. 2024;vol(issue):pages.

Download Post (.PDF)
Slide Up
x
PDF
Scroll to Top