capture log close set more off estimates clear log using cda00b-make-sci-review.log, replace text version 9.2 set scheme s2mono // pgm: cda00b-make-sci-review // task: make the sci-review dataset that is used in excercises // project: CDA Lab Guide - Set-Up // author: tait runnfeldt medina // date: 23May2007 * 1 load the data use science3, clear * 2 isfac - binary gen isfac = (work==1) if (work<.) label variable isfac "1=Faculty in University" label define isfacfmt 0 "0_NotFac" 1 "1_Faculty" label values isfac isfacfmt tab work isfac , m * 3 jobprst - ordinal gen jobprst=job recode jobprst .=. 1/1.99=1 2/2.99=2 3/3.99=3 4/5=4 label variable jobprst "Rankings of University Job." label define jobprstfmt 1 "1_Adeq" /// 2 "2_Good" /// 3 "3_Strg" /// 4 "4_Dist" label values jobprst jobprstfmt bysort jobprst: sum job * 4 pubsum - combine pub vars sum pub3 pub6 pub9 gen pubsum = pub3 + pub6 + pub9 label variable pubsum "Total Pubs in 9 Yrs post-Ph.D." sum pub3 pub6 pub9 pubsum * 8 stjob - binary 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_otherwise" 1 "1_strong" label val stjob stjob tab jobclass stjob , m * 9 hijob - binary gen hijob = (jobclass>2) if jobclass<. label var hijob "Is job high prestige?" label define hijobfmt 0 "0_low prestige job" 1 "1_high prestige job" label values hijob hijobfmt tab jobclass hijob , m * 10 save the new data compress note: cda00b-make-sci-review// trm 23May2007 save sci-review, replace * 11 close log file log close exit