* cda01a-review1.do - CDA Lab Guide 1: Introduction - 23May2007 * routine setup capture log close // close log file if one is open set more off // tells Stata not to pause or display the --more-- message estimates clear // drop all stored estimation results * 1 set up a working directory cd c:\temp * 2 open a log log using cda01a-review1, replace set linesize 80 // specifies screen width version 9.1 // for version control set scheme s2mono // scheme for graphs * 3 load the data use science3, clear * 4 examine the data describe * 5 examine individual variables sum work tab work codebook work * 6 graph variables dotplot work * 7 save graphs graph export cda01a-review1-fig1.emf, replace * 8 add comments tab work // tab is the abbreviation for tabulate * 9 create a dummy variable gen isfac = (work==1) if (work<.) * 10 label variables and values label variable isfac "1=Faculty in University" label define isfacfmt 0 "0_NotFac" 1 "1_Faculty" label values isfac isfacfmt tab isfac * 11 check the transformation tab isfac work * 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 University Job." label define jobprstfmt 1 "1_Adeq" /// 2 "2_Good" /// 3 "3_Strg" /// 4 "4_Dist" label values jobprst jobprstfmt tab jobprst * 14 check the transformation scatter job jobprst, jitter(2) graph export cda01a-review1-fig2.emf, replace * 15 combine variables 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 graph matrix pubsum pub3 pub6 pub9 graph export cda01a-review1-fig3.emf, replace * 16 save the new data save scitemp, replace // Note: this file is called sci_review in later sections. * 17 close log file log close exit // exit do-file