capture log close //closes any open log file. log using icpsrcda01-linear, replace text //opens a log file that //records both commands //and results. // program: icpsrcda01-linear.do // task: Review 1 - Linear Regression // project: ICPSR CDA // author: tait medina \ 2009jun20 // #1 // program setup version 10 //this command is for version control, //ensuring that results can be replicated. clear all //this command removes data, value labels, matrices, //scalars, saved results, etc from memory. set linesize 80 //specifies screen size width. // #2 // Load the data use icpsr_scireview3, clear // #3 // Examine data and select variables codebook, compact keep totpub faculty enrol phd // #4 // Drop cases with missing data and verify misschk, gen(m) tab mnumber keep if mnumber==0 tab1 faculty enrol, miss //use tab to look at categorical vars. sum phd //use sum to look at continuous variables. // #5 // Regression regress totpub faculty enrol phd // #6 // Standardized coefficients listcoef, help // #7 // Interpretations // #8 // Close log file and exit do file log close //closes log file. exit //exit from the do-file.