This course aims to provide participants with the fundamental Stata programming toolkit in order to facilitate, automate, replicate and personalize both data analysis, management and presentation. The course begins by reviewing some general Stata commands, illustrating how they can be combined with some powerful Stata programming constructs for looping and branching. During the two days, participants will be shown how to write, modify and develop do files (user written Stata programs).
At the end of the course, it is expected that participants are able to personalize existing Stata commands and develop their own do files in order to organize their workload in a more automated, efficient, flexible and reproducible manner. Enabling them, for example, to ultimately be in a position to automate the more repetitive tasks of data management, data analysis and data presentation in Stata.
In common with TStat’s course philosophy, each individual session is composed of both a theoretical component (in which the techniques are explained), and an applied (hands-on) segment, during which participants have the opportunity to implement the techniques using real data under the watchful eye of the course tutor. Throughout the course, theoretical sessions are reinforced by case study examples, in which the course tutor discusses and highlights potential pitfalls and the advantages of individual programming techniques.
Researchers or professionals with previous programming skills in other software wishing to work effectively in Stata. Existing Stata users wishing to acquire the “standard” Stata programming toolkit in order to implement basic programming techniques to effectively automate a substantial part of their empirical data analysis.
It is expected that individuals wishing to follow this course have a familiarity/working knowledge of Stata. Participants are not however, required to have any programming experience in Stata or in other statistical packages.
SESSION I: FUNDAMENTAL CONCEPTS/COMMANDS FOR STATA PROGRAMMING: A QUICK REVIEW
Developing effective DO-files in Stata
Tracking your workflow
DO-files, LOG-files and labelling
Managing directories and folders:
pwd, mkdir, cd, dir, copy, erase, type
The Stata command syntax
Reading data into Stata
Import and exporting data from Excel and delimited .txt files
Variable and data types
numeric, string and missing data
Sub-setting the data using the if and in qualifiers
Stata’s exploratory data analysis commands – browse, edit, assert, describe, codebook, summarize, tabulate, inspect, graph
Creating and manipulating variables
generate, egen, replace, rename, recode and replace
Converting strings to numerics and vice versa
tostring, destring, encode
Codifying missing values
mvdecode and mvencode
Generate dummy variables, lags and leads
Working with dates in Stata
SESSION II: ORGANISING, MANIPULATING AND VISUALIZING YOUR DATASETS WITHIN A DO-FILE
Saving the dataset
save, preserve, restore
Advanced data management commands
keep and drop
sort and gsort
merge and joinby
collapse and contract
order, aorder, move, reshape (for panel data)
SESSION III: STATA CONSTRUCTS FOR DO-FILE PROGRAMMING
Global and local macros
Scalars and matrices
Extended macro functions
Macro increment and decrement functions
Advanced local macro manipulation
Temporary variables: tempvar
Temporary Matrices and vectors: tempname
Temporary Files: tempfile
Looping in Stata
Looping using foreach
Looping using forvalues
Looping using while
Branching in Stata with: if and else
Writing and modifying a Stata program
Programs without arguments
Programs with positional arguments
Programs with named positional arguments
Storing and retrieving program results
Programs with arguments using the syntax construct
SESSION IV: AUTOMATION DO-FILE PROGRAMMING IN PRACTICE – MAKING LIFE A EASIER!
A DO-file template
Master and Using DO-files
Speeding-up your workflow within a DO-file: real examples
Running estimations under alternative model specifications
Building, modifying and automating tables of estimation output
Returning estimation (return, ereturn)
Building, modifying and automating graphs
Stata graphic capabilities
The syntax of the graph command
The course will take place in:
Munich, 24th-25th October 2019
Berlin, 20th-21st February 2020
Students*: € 526.00
University: € 781.00
Non-Profit/Public Research Centres: € 986.00
Commercial: € 1095.00
**To be eligible for student prices, participants must provide proof of their full-time student status for the current academic year.
Fees are subject to VAT (applied at the current Italian rate of 22%). Under current EU fiscal regulations, VAT will not however applied to companies, Institutions or Universities providing a valid tax registration number.
Course fees cover: course materials (handouts, Stata do files and datasets to used during the course), a temporary licence of Stata valid for 30 days from the beginning of the course, light lunch and coffee breaks.
The number of participants is limited to 8. Places, will be allocated on a first come, first serve basis. The course will be officially confirmed, when at least 5 individuals are enrolled.
To maximize the usefulness of this course, we strongly recommend that participants bring their own laptops with them, to enable them to actively participate in the empirical sessions.
Individuals interested in attending the training course, must return their completed registration forms to TStat by:
2nd October 2019 for the Munich edition and
1st February 2020 for the Berlin edition
This course aims to provide participants with the fundamental Stata programming toolkit in order to facilitate, automate, replicate and personalize both data analysis, management and presentation. The course begins by reviewing some general Stata commands, illustrating how they can be combined with some powerful Stata programming constructs for looping and branching. During the two days, participants will be shown how to write, modify and develop do files (Stata programs).