(Stata) Data cleaning and variables

1. Stata的variable name不能是數字


2. 有local和沒有local的差異

local poli p5 democ autoc polity2 durable


foreach v of local poli{

  

label variable `v' "from polity"

  } 

  

   foreach v of varlist mtemp1-mtemp12 {

    label variable `v' "from polity"

  } 


3. Change a "categorical variable" to multiple dummy variables. 

tab coup1, m



tab coup1, gen(coup1_dum)

持續更新中




Comments

Popular Posts