2 2018 4 13 1 / 24
1. 2. Excel 3. Stata 4. Stata 5. Stata 2 / 24
1 cross section data e.g., 47 2009 time series data e.g., 1999 2014 5 panel data e.g., 47 1999 2014 5 3 / 24
micro data aggregate data 4 / 24
2009 5 / 24
Excel 1 2 1 3 2 4 3 Stata 13 6 / 24
Excel A B C D E 1 prefecture income expenditure male female 2 Hokkaido 227,349 155,491 1 0 3 Aomori 233,967 175,207 1 0...... 48 Okinawa 214,233 137,726 1 0 49 Hokkaido 207,155 172,835 0 1 50 Aomori 169,422 143,179 0 1...... 95 Okinawa 144,644 139,716 0 1 7 / 24
1 1. Excel consumption2009.xlsx 2018microdata1 2. A1 prefecture B1 income C1 expenditure D1 male E1 female 3. b134-2.xls B134-2 P11 BJ11 4. consumption2009.xlsx A2 8 / 24
5. consumption2009.xlsx A 2 Hokkaido, Aomori, Iwate, Miyagi, Akita, Yamagata, Fukushima, Ibaraki, Tochigi, Gumma, Saitama, Chiba, Tokyo, Kanagawa, Niigata, Toyama, Ishikawa, Fukui, Yamanashi, Nagano, Gifu, Shizuoka, Aichi, Mie, Shiga, Kyoto, Osaka, Hyogo, Nara, Wakayama, Tottori, Shimane, Okayama, Hiroshima, Yamaguchi, Tokushima, Kagawa, Ehime, Kochi, Fukuoka, Saga, Nagasaki, Kumamoto, Oita, Miyazaki, Kagoshima, Okinawa 6. consumption2009.xlsx A2 A48 A49 9 / 24
7. b134-2.xls B134-2 P37 BJ37 8. consumption2009.xlsx B2 9. b134-2.xls B134-2 P39 BJ39 10. consumption2009.xlsx C2 11. consumption2009.xlsx D2 D48 1 12. consumption2009.xlsx E2 E48 0 10 / 24
13. b134-2.xls B134-2 (2) P37 BJ37 14. consumption2009.xlsx B49 15. b134-2.xls B134-2 (2) P39 BJ39 16. consumption2009.xlsx C49 17. consumption2009.xlsx D49 D95 0 18. consumption2009.xlsx E49 E95 1 11 / 24
19. consumption2009.xlsx B17 C17 - missing value - Stata 20. consumption2009.xlsx 12 / 24
1 0 dummy variable male female 2 male 1 0 female 1 0 13 / 24
Stata Stata Excel Ver. 13 xls xlsx 14 / 24
Stata Word 1 Stata 15 / 24
2 1. Stata 13 2. File Log Begin... 2018microdata1 lecture20180413.smcl 3. File Import Excel spreadsheet (*.xls; *.xlsx) 4. Excel file: Browse... 5. 2018microdata1 consumption2009.xlsx 6. Import first row as variable names OK 16 / 24
7. File Save as 2018microdata1 consumption2009.dta 8. Command list prefecture income expenditure male female Enter list more 17 / 24
Command generate ( )=( ) generate Data Create or change data Create new variable Variable name: Specify a value or an expression Specify a value or an expression Create... 18 / 24
income expenditure 1,000 19 / 24
3 1. Command generate income_th=income/1000 Enter 2. Command generate expenditure_th =expenditure/1000 Enter 3. Command list prefecture income income_th expenditure expenditure_th male female Enter list 20 / 24
Command summarize ( ) Enter number of observations (mean) (standard deviation) (minimum) (maximum) 21 / 24
Obs: n. Mean: x = 1 n x i. n i=1 Std. Dev.: 1 n sx = (x i x) 2. n 1 Min: min{xi }. Max: max{x i }. i=1 22 / 24
4 1. Command summarize income income_th expenditure expenditure_th male female Enter list 2. Edit Copy 3. Word summary20180413.docx 2018microdata1 23 / 24
5 Stata 1. File Log Close 2. Stata 13 3. 2018microdata1 lecture20180413.smcl 24 / 24