*******************************************************. *** 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 1: CORE DATA MANAGEMENT WITH STATA ** ** ** www.dames.org.uk ** Paul Lambert / Vernon Gayle, 24 August 2009 *******************************************************. *******************************************************. *******************************************************. ****** LAB 1 MASTER FILE *******************************************************. *******************************************************. global lab1loc "d:\dames09\do_files\" do $lab1loc\lab0.do do $lab1loc\lab1_highlights.do *******************************************************. *******************************************************. ***** Comments on the above: ** A master file is most useful which it shows a concise sequential list of necessary * commands - the list above. ** In this instance, we don't really want to run all the files in a single loop * (and in any case they will be tripped up by deliberate errors within them before * finishing) but it is a useful documentation device to list the files anyway. ** Below we explain a little what is involved in them. *******************************************************. **** i) PATH SPECIFICATIONS *******************************************************. *global lab1loc "S:\DAMES\workshops\stir_training_aug09\content\3_lab1_core\do_files\" **** Comments: ** This command specifies a 'macro' which records the path where the sub-files * called upon below are located . ** You'll need to adjust it to the suitable path on the machine you're using. ** When you invoke the sub-files, those files will themselves * define a number of further data paths in due course * (the specifications coming at the top of the respective files). ** Some users prefer to keep all their path specifications in a single separate do file, * and define all paths at once by invoking that file, e.g. "do paths.do" **** *******************************************************. *******************************************************. *******************************************************. **** ii) LAB0.DO : AN EXTERNAL FILE *******************************************************. ** INSTRUCTION: OPEN AND PROCEED THROUGH THE CONTENTS OF 'LAB0.DO' ****** ** 'lab0.do' features a general introduction to data management and data analysis * in Stata. ** It was generated in a related ESRC project called 'Longitudinal Data Analysis for * Social Science Researchers' ** It is a very long file which features explanatory notes on its components. * ** We recommend taking your time to work through the file as a good way to learn * Stata to a reaonsably advanced level. * ****** * For good documentation.... : *capture log close *log using $lab1loc\lab0_log.txt, replace text *do $lab1loc\lab0.do *capture log close ****** ** We don't recommend that you invoke the file in a single go - but the above command * illustrates how you could go about that if you wanted to. ** (You would also need to comment out the 'STOP' text at the top of the file - something * which is explained within the subfile). ***** *******************************************************. *******************************************************. *******************************************************. **** iii) LAB1_HIGHLIGHTS.DO : A SHORT DATA MANAGEMENT HIGHLIGHTS FILE *******************************************************. ***** 'data management highlights' - you're kidding, right? ** INSTRUCTION: OPEN AND PROCEED THROUGH THE CONTENTS OF 'LAB0.DO' * Alternatively... : *capture log close *log using $lab1loc\lab1_highlights_log.txt, replace text *do $lab1loc\lab1_highlights.do *capture log close ****** ** We recommend opening this file in your do editor and working your way through it. ** We've picked out some illustrations of common and useful data management features * as they are implemented in Stata. ****** *******************************************************. *******************************************************. ** EOF.