Data Management in Stata
Samuel DeWitt
Part I β March 2nd, 2016
1
Organization
2
1) Why is Data Management Important?
3
2-A) Sample Data
4
2-B) Some Preliminary Definitions
Data in βWideβ Format
Data in βLongβ Format
5
id | wave | variety |
24 | 1 | |
24 | 2 | |
1341 | 1 | |
1341 | 2 | |
4755 | 1 | |
4755 | 2 | |
id | variety1 | variety2 |
24 | | |
1341 | | |
4755 | | |
2-C) Some Preliminary Definitions
Information to Know
Data in βWideβ Format
6
id | variety1 | variety2 |
24 | | |
1341 | | |
4755 | | |
2-D) Some Preliminary Definitions
Information to Know
Data in βLongβ Format
7
id | wave | variety |
24 | 1 | |
24 | 2 | |
1341 | 1 | |
1341 | 2 | |
4755 | 1 | |
4755 | 2 | |
3) Basic Functions to Know β A Short, Incomplete List
8
3-A) Basic Functions to Know: By & Bysort
9
3-B) Basic Functions to Know: Egen
10
3-C) Basic Functions to Know: Reshape
11
3-D) Basic Functions to Know: Gsort
12
3-E) Basic Functions to Know: Lags and Leads
13
3-F) Basic Functions to Know: Carryforward
14
4) Data Exercises with Basic Functions
Or, the complicated nature of things that should,
by all means, be easier than they are.
15
5) Advanced Functions to Know β Another Short, Incomplete List
16
5-A) Advanced Functions to Know: Import and Export
17
5-B) Basic Functions to Know: Merge
18
5-C) Basic Functions to Know: Global and Local
19
5-D) Basic Functions to Know: Foreach and Forvalues
20
5-E) Basic Functions to Know: While
21
5-F) Basic Functions to Know: Statsby
22
6) Data Exercises with Advanced Functions
Or, the simple nature of things that should,
by all means, be harder than they are.
23
7) Some Other Functions to Learn
24
8) Special Topics
Or, where you ask me questions
I may or may not know the answer to.
25
9) El Fin
Or, where I go home and put my pajamas back on.
26