Skip to content

Instantly share code, notes, and snippets.

@kevinmichaelchen
Created October 30, 2014 13:48
Show Gist options
  • Save kevinmichaelchen/5c63720ff7d3ef66fe4c to your computer and use it in GitHub Desktop.
Save kevinmichaelchen/5c63720ff7d3ef66fe4c to your computer and use it in GitHub Desktop.
Reshape wide format to long format (Stata)
#delimit ;
cap log close;
cd "~/Dropbox/econ381_project";
log using "project.log", text replace;
insheet using "health_status.csv", comma;
reshape long
all_ne_evg_ all_ne_g_ all_ne_fp_
all_mw_evg_ all_mw_g_ all_mw_fp_
all_s_evg_ all_s_g_ all_s_fp_
all_m_evg_ all_m_g_ all_m_fp_
all_p_evg_ all_p_g_ all_p_fp_
poor_ne_evg_ poor_ne_g_ poor_ne_fp_
poor_mw_evg_ poor_mw_g_ poor_mw_fp_
poor_s_evg_ poor_s_g_ poor_s_fp_
poor_m_evg_ poor_m_g_ poor_m_fp_
poor_p_evg_ poor_p_g_ poor_p_fp_
nearpoor_ne_evg_ nearpoor_ne_g_ nearpoor_ne_fp_
nearpoor_mw_evg_ nearpoor_mw_g_ nearpoor_mw_fp_
nearpoor_s_evg_ nearpoor_s_g_ nearpoor_s_fp_
nearpoor_m_evg_ nearpoor_m_g_ nearpoor_m_fp_
nearpoor_p_evg_ nearpoor_p_g_ nearpoor_p_fp_
nonpoor_ne_evg_ nonpoor_ne_g_ nonpoor_ne_fp_
nonpoor_mw_evg_ nonpoor_mw_g_ nonpoor_mw_fp_
nonpoor_s_evg_ nonpoor_s_g_ nonpoor_s_fp_
nonpoor_m_evg_ nonpoor_m_g_ nonpoor_m_fp_
nonpoor_p_evg_ nonpoor_p_g_ nonpoor_p_fp_,
i(age) j(year);
log close;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment