The words you are searching are inside this book. To get more targeted content, please make full-text search by clicking here.
Discover the best professional documents and content resources in AnyFlip Document Base.
Search
Published by Yanto Yanto, 2020-11-07 22:10:30

Format & Set Data Stata

Format & Set Data Stata

Format & Set Data Stata

Tipe Data: cross section

obs INFLRATE UNRATE

1960 1.7 5.5
6.7
1961 1 5.5
5.7
1962 1 5.2
4.5
1963 1.3 3.8
3.8
1964 1.3 3.6
3.5
1965 1.6 4.9
5.9
1966 2.9 5.6
4.9
1967 3.1 5.6
8.5
1968 4.2 7.7
7.1
1969 5.5 6.1
5.8
1970 5.7

1971 4.4

1972 3.2

1973 6.2

1974 11

1975 9.1

1976 5.8

1977 6.5

1978 7.6

1979 11.3

Tipe Data: time series

obs INFLRATE UNRATE • generate tahun = obs
• format %ty tahun
1960 1.7 5.5 • tsset tahun, yearly
6.7
1961 1 5.5
5.7
1962 1 5.2
4.5
1963 1.3 3.8
3.8
1964 1.3 3.6
3.5
1965 1.6 4.9
5.9
1966 2.9 5.6
4.9
1967 3.1 5.6
8.5
1968 4.2 7.7
7.1
1969 5.5 6.1
5.8
1970 5.7

1971 4.4

1972 3.2

1973 6.2

1974 11

1975 9.1

1976 5.8

1977 6.5

1978 7.6

1979 11.3

Tipe Data: time series

obs INFLRATE UNRATE 5.5 • generate kuartal = quarterly(obs,"yq")
1960q1 1.7 6.7 • format %tq kuartal
1960q2 1 5.5 • tsset kuartal, quarterly
1960q3 1 5.7 • drop in 11/12
1960q4 1.3 5.2 • tsfill, full
1961q1 1.3 4.5
1961q2 1.6 3.8
1961q3 2.9 3.8
1961q4 3.1 3.6
1962q1 4.2 3.5
1962q2 5.5 4.9
1962q3 5.7 5.9
1962q4 4.4 5.6
1963q1 3.2 4.9
1963q2 6.2 5.6
1963q3 11 8.5
1963q4 9.1 7.7
1964q1 5.8 7.1
1964q2 6.5 6.1
1964q3 7.6 5.8
1964q4
11.3

Tipe Data: panel

obs INFLRATE UNRATE Country • generate tahun = obs
1960q1 1.7 • format %ty tahun
1960q2 1 5.5 A • generate cs=.
1960q3 1 6.7 B • replace cs = 1 if country =="A"
1960q4 1.3 5.5 C • replace cs = 2 if country =="B"
1961q1 1.3 5.7 D • replace cs = 3 if country =="C"
1961q2 1.6 5.2 E • replace cs = 4 if country =="D"
1961q3 2.9 4.5 A • replace cs = 5 if country =="E"
1961q4 3.1 3.8 B • xtset cs tahun, yearly
1962q1 4.2 3.8 C
1962q2 5.5 3.6 D
1962q3 5.7 3.5 E
1962q4 4.4 4.9 A
1963q1 3.2 5.9 B
1963q2 6.2 5.6 C
1963q3 11 4.9 D
1963q4 9.1 5.6 E
1964q1 5.8 8.5 A
1964q2 6.5 7.7 B
1964q3 7.6 7.1 C
1964q4 6.1 D
11.3 5.8 E

terima kasih

PR / TUGAS / EVALUASI
PRINTSCREEN CONTOH LATIHAN DARI FORMAT/STRUKTUR & SET DATA

(MASING-MASING DATA: CROSS-SECTION, TIMES SERIES, PANEL)
GUNAKAN DATA FIKTIF DAN DATANYA TIDAK BOLEH SAMA


Click to View FlipBook Version