* CDA Lab Guide 1: Introduction - 09Jun2005 capture log close version 9 set scheme s2mono // scheme for graphs set more off * 1 set up a working directory *cd c:\tenp * 2 open a log log using cda_review1.log, replace text * 3 load the data use science2, clear * 9 create a dummy variable gen isfac = (work==1) if (work<.) *11 label variables and values label variable isfac "Is faculty member at university?" label define isfacfmt 0 "0NotFac" 1 "1Faculty" label values isfac isfacfmt tab isfac *12 create an ordinal variable tab job, missing gen jobprst=job recode jobprst .=. 1/1.99=1 2/2.99=2 3/3.99=3 4/5=4 *13 label variables and label values label variable jobprst "Rankings of academic job." label define jobprstfmt 1 "1Adeq" /// 2 "2Good" /// 3 "3Strg" /// 4 "4Dist" label values jobprst jobprstfmt tab jobprst *15 combine variables sum pub3 pub6 pub9 gen pubsum = pub3 + pub6 + pub9 label variable pubsum "Total aritcles in 9 years since Ph.D." *16 variable used for test exercise gen stjob = jobclass replace stjob = . if jobclass==4 // drop distinguished replace stjob = 1 if jobclass==3 replace stjob = 0 if jobclass==1 replace stjob = 0 if jobclass==2 label var stjob "Strong academic job?" label def stjob 0 "0=2) if jobclass<. label var hijob "Is job high prestige?" label define hijobfmt 0 "low prestige job" 1 "high prestige job" label values hijob hijobfmt tab hijob jobclass, m *17 save the new data compress note: cda_make_sci_review.do jsl 11Jun2005 save sci_review, replace *18 close log file log close