Famine Code 3

This do-file creates Tables 2 (p. 61) and 3 (p. 63) in the SSR paper.
// Task: diff-in-diff models
// Project: Chinese Famine & Self-rated Health

*****************************************************************
*** 0. Program setup
*****************************************************************

version 11.2
clear all
macro drop _all
set mem 1000m
set linesize 80
set more off

*****************************************************************
*** 1. Open data, drop unused cases, and global
*****************************************************************
**************************************************
*** 1.1. open data and drop unused cases
**************************************************

use "2014-02-24_clean10a_SocScienceRes_58notinfamine", clear
keep if rural_newfm == 1 & fmparty < .
drop if rural_b1f == 0 | rural_b1m == 0

  replace province = 51 if province == 50 //chongqing in Sichuan around the famine period

**************************************************
*** 1.2. global
**************************************************

global health "FH"
global by "by1955 by1956 by1957 by1958 by1959 by1960 by1961 by1962"
global edr1by "edr11955 edr11956 edr11957 edr11958 edr11959 edr11960 edr11961 edr11962"

*****************************************************************
*** 2. Diff-in-diff: health
*****************************************************************
**************************************************
*** 2.1. models (Table 2)
**************************************************

foreach var in $health {
  reg `var' pre famine edr1 preedr1 famineedr1 age i.province if male == 1, vce(cluster province)
  outreg2 using "MainEffects_health", excel bdec(3) alpha(0.001, 0.01, 0.05, 0.1) symbol(***, **, *, +)

  reg `var' pre famine edr1 preedr1 famineedr1 age i.province if male == 0, vce(cluster province)
  outreg2 using "MainEffects_health", excel bdec(3) alpha(0.001, 0.01, 0.05, 0.1) symbol(***, **, *, +)
}

foreach var in $health {
  reg `var' pre famine edr1 preedr1 famineedr1 age i.province if group2 == 1, vce(cluster province)
  outreg2 using "MainEffects_health", excel bdec(3) alpha(0.001, 0.01, 0.05, 0.1) symbol(***, **, *, +)

  reg `var' pre famine edr1 preedr1 famineedr1 age if group2 == 2, vce(cluster province)
  outreg2 using "MainEffects_health", excel bdec(3) alpha(0.001, 0.01, 0.05, 0.1) symbol(***, **, *, +)

  reg `var' pre famine edr1 preedr1 famineedr1 age i.province if group2 == 3, vce(cluster province)
  outreg2 using "MainEffects_health", excel bdec(3) alpha(0.001, 0.01, 0.05, 0.1) symbol(***, **, *, +)

  reg `var' pre famine edr1 preedr1 famineedr1 age if group2 == 4, vce(cluster province)
  outreg2 using "MainEffects_health", excel bdec(3) alpha(0.001, 0.01, 0.05, 0.1) symbol(***, **, *, +)
}

**************************************************
*** 2.2. tests
**************************************************

reg FH pre famine edr1 preedr1 famineedr1 age ib11.province if group2 == 1
est store m5
reg FH pre famine edr1 preedr1 famineedr1 age if group2 == 2
est store m6
reg FH pre famine edr1 preedr1 famineedr1 age ib11.province if group2 == 3
est store m7
reg FH pre famine edr1 preedr1 famineedr1 age if group2 == 4
est store m8

foreach var in $health {
  suest m5 m6 m7 m8, vce(cluster province)
  test [m5_mean]famineedr1 = [m6_mean]famineedr1 = [m7_mean]famineedr1 = [m8_mean]famineedr1
  test [m5_mean]famineedr1 - [m6_mean]famineedr1 = [m7_mean]famineedr1 - [m8_mean]famineedr1

  // SES difference in men
  suest m5 m6, vce(cluster province)
  test [m5_mean]famineedr1 = [m6_mean]famineedr1

  // SES difference in women
  suest m7 m8, vce(cluster province)
  test [m7_mean]famineedr1 = [m8_mean]famineedr1
}
est clear

**************************************************
*** 2.3. sensitivity: use birthyear (Appendix D)
**************************************************

foreach var in $health {
  reg `var' $by edr1 $edr1by age i.province if group2 == 1, vce(cluster province)
  outreg2 using "MainEffects_health2", excel bdec(3) alpha(0.001, 0.01, 0.05, 0.1) symbol(***, **, *, +)

  reg `var' $by edr1 $edr1by age if group2 == 2, vce(cluster province)
  outreg2 using "MainEffects_health2", excel bdec(3) alpha(0.001, 0.01, 0.05, 0.1) symbol(***, **, *, +)

  reg `var' $by edr1 $edr1by age i.province if group2 == 3, vce(cluster province)
  outreg2 using "MainEffects_health2", excel bdec(3) alpha(0.001, 0.01, 0.05, 0.1) symbol(***, **, *, +)

  reg `var' $by edr1 $edr1by age if group2 == 4, vce(cluster province)
  outreg2 using "MainEffects_health2", excel bdec(3) alpha(0.001, 0.01, 0.05, 0.1) symbol(***, **, *, +)
}

**********************************************************************
*** 3. Diff-in-diff: SES outcomes
**********************************************************************
**************************************************
*** 3.1. models (Table 3)
**************************************************

foreach var in edu lninc {
  reg `var' pre famine edr1 preedr1 famineedr1 age i.province if group2 == 1, vce(cluster province)
  outreg2 using "MainEffects_ses", excel bdec(3) alpha(0.001, 0.01, 0.05, 0.1) symbol(***, **, *, +)

  reg `var' pre famine edr1 preedr1 famineedr1 age if group2 == 2, vce(cluster province)
  outreg2 using "MainEffects_ses", excel bdec(3) alpha(0.001, 0.01, 0.05, 0.1) symbol(***, **, *, +)

  reg `var' pre famine edr1 preedr1 famineedr1 age i.province if group2 == 3, vce(cluster province)
  outreg2 using "MainEffects_ses", excel bdec(3) alpha(0.001, 0.01, 0.05, 0.1) symbol(***, **, *, +)

  reg `var' pre famine edr1 preedr1 famineedr1 age if group2 == 4, vce(cluster province)
  outreg2 using "MainEffects_ses", excel bdec(3) alpha(0.001, 0.01, 0.05, 0.1) symbol(***, **, *, +)
}

**************************************************
*** 3.2. tests
**************************************************

reg edu pre famine edr1 preedr1 famineedr1 age ib11.province if group2 == 1
est store m5
reg edu pre famine edr1 preedr1 famineedr1 age if group2 == 2
est store m6
reg edu pre famine edr1 preedr1 famineedr1 age ib11.province if group2 == 3
est store m7
reg edu pre famine edr1 preedr1 famineedr1 age if group2 == 4
est store m8
foreach var in edu lninc {
  suest m5 m6 m7 m8, vce(cluster province)
  test [m5_mean]famineedr1 = [m6_mean]famineedr1 = [m7_mean]famineedr1 = [m8_mean]famineedr1
  test [m5_mean]famineedr1 - [m6_mean]famineedr1 = [m7_mean]famineedr1 - [m8_mean]famineedr1

  // SES difference in men
  suest m5 m6, vce(cluster province)
  test [m5_mean]famineedr1 = [m6_mean]famineedr1

  // SES difference in women
  suest m7 m8, vce(cluster province)
  test [m7_mean]famineedr1 = [m8_mean]famineedr1
}
est clear