The idea of approximation
(stata) 데이터 일부만 사용하기 본문
drop 이나 keep으로 데이터 셋 전체의 샘플 수를 바꾸지 않고,
일부만 사용해서 분석할 때 if 조건문을 계속 붙이지 않는 방법
1) preserve로 기존 데이터 셋을 저장해놓고
2) keep if ... 로 일부 조건에 맞는 데이터셋을 만들어 분석한 뒤,
3) 분석을 끝내고 restore를 하면 됨
<예시>
preserve
keep if c0000_g>0
estimates clear
reg emkepl_g emkrevi1_g othrevi1_g c0004_g c0003_g ngdpr
estimates store m_ols
xtreg emkepl_g emkrevi1_g othrevi1_g c0004_g c0003_g ngdpr, fe
estimates store m_fe
xtreg emkepl_g emkrevi1_g othrevi1_g c0004_g c0003_g ngdpr, re
estimates store m_re
xtreg emkepl_g emkrevi1_g othrevi1_g c0004_g c0003_g ngdpr, be
estimates store m_be
estout m*, cells(b(star fmt(3))) starlevels( * 0.10 ** 0.05 *** 0.010) stats(Year_d r2_a N Mvif, fmt(0 3 0 2) label(Year_d R_a OBS Mvif)) keep(emkrevi1_g othrevi1_g c0004_g c0003_g ) order(emkrevi1_g othrevi1_g c0004_g c0003_g ) varwidth(10)
estimates clear
restore