Index
General training page
Stata training page
FAQ page
What to do first?
Stata’s screen
Create a log file
Set a working directory
Allocate memory
Open a Stata file
From Excel to Stata
The "quickie" way
The "insheet" way
Data as *.txt, *.dat, *.raw, etc.
ASCII data (using Stata infix, infile)
Running a dictionary file
ASCII data (using SPSS)
Data from portable SPSS
Dealing with zip files (compressed)
Data manipulation
Reshape
Preparing the data
Wide to long
Long to wide
Merge / Append / Reclink
Adding value labels
Adding variable names
Rename
String to numeric (destring)
Value to missing
Date variables
d-m-yy
m/d/yyyy
yyyymd
Deconstructing
String with day of the week
Time variables
Foreach (looping vars)
Forvalues (looping values)
Encode command
Moving average for panel data
Extracting from numeric/string combination
Start exploring your data
Describing the data
The list command
The summarize command
Getting a codebook
Basic commands
Frequencies (tab)
Crosstabs
Tab1
Tabstat
Tab/summ
Proper
One-way ANOVA
t-test
Some graphs
Scatter
Regression
Quadrants
Histogram
Bar
Categorical
Factor Analysis
Interpretation
Descriptive Statistics (Excel/Stata)
Programming in STATA (the do-files)
Do-file definition
Do-file Hello1.do
Reading data: Read1.do (using infile, ascii data)
Reading data: Read2.do (using insheet, excel data)
Reading data: Read2.do (keeping vars)
Reading multiple files: Read3.do (using macros)
Converting F to C: Convert.do (example using macros)
Looping
Generate and summarize (z-values example)
Encode command
Foreach command (looping, zvalue.do, macros)
Forvalues command (looping, line.do, macros, graph)
Exercise
References
STATA on PU Networks
Thank you to Ashley Miller for this pdf document. Please contact her for any questions on this at ashleym@princeton.edu.