*******************************************************. *** Data Management through e-Social Science ** ** www.dames.org.uk ** ** ** ESRC DAMES Research Node, data management training programme: ** ** ** Workshop of 24-25 August 2009 ** Data Management for Social Survey Research ** ** ** LAB 2: ADVANCED DATA MANAGEMENT WITH STATA ** ** ** www.dames.org.uk ** Paul Lambert / Vernon Gayle, 24 August 2009 *******************************************************. *******************************************************. *******************************************************. ****** LAB 2 MASTER FILE *******************************************************. *******************************************************. *******************************************************. ****** Contents: * * * profile.do * file_matching_extensions.do * documentation_for_replication.do * variable_operationalisations.do * rae_exemplar.do *******************************************************. *******************************************************. **** i) PROFILE.DO *******************************************************. ** INSTRUCTIONS: 1) OPEN AND INSPECT THE COPY OF THE DO FILE 'PROFILE.DO' ** WHICH IS AVAILABLE ON THW WEBSITE OR IN THE S DRIVE FOR LAB PARTICIPANTS adopath ** 2) SAVE THE 'PROFILE.DO' FILE TO ONE OF THE DIRECTORIES LISTED AFTER * THE 'ADOPATH' COMMAND, SUCH AS 'C:\ado\' IF APPLICABLE ** ** 3) EXIT AND RE-OPEN YOUR STATA SESSION * *** Observe that from now on, when you open Stata the 'profile.do' command * is run, and this sets up a few shortcuts and definitions * to your sessions. You could of course edit / add some new * commands to the profile file. * Such specifications can prove extremely helpful in complex data management operations. *** datetime ** type the 'F8' key on the command interface ** Comments: The two above actions now invoke small macros which were defined * by the profile file *** This note drew heavily on p355-6 of: * Long, J. S. (2009). The Workflow of Data Analysis Using Stata. Boca Raton: CRC Press. *** *******************************************************. *******************************************************. *******************************************************. **** ii) PATH SPECIFICATIONS *******************************************************. global lab2loc "d:\dames09\do_files\" **** Comments: ** This command specifies a 'macro' which records the path where the sub-files * called upon below are located . *******************************************************. *******************************************************. *******************************************************. **** iii) FILE MATCHING EXTENSIONS *******************************************************. capture log close log using $lab2loc\file_matching_extensions_log.txt, replace text do $lab2loc\file_matching_extensions.do capture log close *******************************************************. **** iv) DOCUMENTATION FOR REPLICATION *******************************************************. capture log close log using $lab2loc\documentation_for_replication_log.txt, replace text do $lab2loc\documentation_for_replication.do capture log close *******************************************************. **** v) VARIABLE_OPERATIONALISATIONS.DO *******************************************************. ** INSTRUCTION: OPEN AND PROCEED THROUGH THE CONTENTS OF ' VARIABLE_OPERATIONALISATIONS.DO' capture log close log using $lab2loc\variable_operationalisations_log.txt, replace text do $lab2loc\variable_operationalisations.do capture log close *******************************************************. *******************************************************. *******************************************************. **** vi) RAE Exemplar analysis *******************************************************. capture log close log using $lab2loc\rae_exemplar_log.txt, replace text do $lab2loc\rae_exemplar.do capture log close *******************************************************. *******************************************************. *******************************************************. *******************************************************. ** EOF.