Introduction to Stata 8 - (GRIPS
Introduction to Stata 8 - (GRIPS
Introduction to Stata 8 - (GRIPS
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Frequently used SPSS commands and the similar <strong>Stata</strong> commands<br />
SPSS command<br />
Data in and out<br />
DATA LIST<br />
GET FILE<br />
SAVE OUTFILE<br />
Similar <strong>Stata</strong> command<br />
infile; infix; insheet<br />
use<br />
save<br />
Documentation commands etc.<br />
VARIABLE LABELS<br />
VALUE LABELS<br />
FORMAT sex (F1.0).<br />
64<br />
label variable<br />
label define followed by<br />
label values<br />
format sex %1.0f<br />
MISSING VALUES Missing values are special; see section 6.3.<br />
COMMENT; * * or //<br />
DOCUMENT<br />
DISPLAY DICTIONARY<br />
Calculations<br />
COMPUTE<br />
IF (sex=1) y=2.<br />
RECODE a (5 thru 9=5) INTO agr.<br />
DO REPEAT ... END REPEAT<br />
SELECT IF<br />
TEMPORARY.<br />
SELECT IF (sex=1).<br />
note<br />
describe; codebook<br />
generate; replace; egen<br />
generate y=2 if sex==1<br />
recode a (5/9=5) , generate(agr)<br />
for; foreach; forvalues<br />
keep if; drop if<br />
command if sex==1<br />
SAMPLE 0.1. sample 10<br />
SPLIT FILE<br />
WEIGHT<br />
Analysis<br />
DESCRIPTIVES<br />
FREQUENCIES<br />
CROSSTABS<br />
MEANS bmi BY agegrp.<br />
T-TEST<br />
LIST<br />
WRITE<br />
Advanced<br />
SORT CASES BY<br />
AGGREGATE<br />
ADD FILES<br />
MATCH FILES<br />
by...:<br />
Weights can be included in most commands; see<br />
section 7.<br />
summarize<br />
tabulate; tab1<br />
tabulate; tab2<br />
oneway bmi agegrp , tabulate<br />
ttest<br />
list<br />
outfile; outsheet<br />
sort<br />
collapse<br />
append<br />
merge