Preface#
Welcome to 340.600 Stata Programming I (Basic).
Should you have inquiries about 340.700 Programming II (Intermediate), please do not hesitate to reach out to your Analytic Mentor. For those curious about Stata Programming III (Advanced), we regret to inform you that no offering will be available this year. Nevertheless, you can explore content pertinent to advanced Stata Programming here.
The Basic
class adopts a hybrid format to accommodate both in-person attendees at the Bloomberg School’s Wolfe W1214 (Sheldon Hall) and virtual participants via Zoom (link). We encourage in-person participants to also connect to Zoom, facilitating code sharing and collective debugging, a highlight of the learning experience as described by last year’s students.
In contrast, solely in-person formats without a Zoom option hinder students’ ability to express their challenges, complicating collective problem-solving.
Our class structure is as follows:
Class: Thursdays, 3:30-5:20pm lecture
Labs: Monday to Friday
HW: Sets for Weeks [1, 2, 3], [4, 5], and [6, 7]
We will evaluate your progress weekly:
A graded homework every week for more immediate feedback
Week 1-3 content equals HW 1 from prior years
Week 4-5 content equals HW 2 from prior years
Week 6-7 content equals HW 3 from prior years
An optional assignment at the class’s end
Complete and timely homework submission guarantees at least a B grade
For general inquiries about Course logistics, etc., please use the CoursePlus Discussion Forum. For confidential matters (e.g., grades), email your course team directly.
Join our new Stata-focused discussion community on GitHub for all your code-related queries! Whether you’re looking to share snippets, troubleshoot issues with your peers, or dive into broader discussions within the Hopkins Stata community, GitHub is your go-to platform. Don’t have a GitHub account yet? No worries—it’s quick and easy to sign up. This platform not only facilitates collaboration with your classmates and instructors but also connects you to the wider Stata-using community at Hopkins even after completion of this course. Get ready to enhance your coding journey by tapping into the collective wisdom and insights available right at your fingertips.
Sharing code on the GitHub discussion forum is straightforward. Simply enclose your code snippet or an entire .do
file’s contents within triple backquotes for syntax highlighting, like this:
```stata
copy & paste your code snippet here
```
You don’t need to upload .do
files. For Python or R code, just replace “stata” with “python” or “r” respectively. This syntax highlighting enhances readability, making it easier for peers to understand your code. This is why we prefer GitHub for discussing code-related queries over CoursePlus. Feel free to mix your explanations with code snippets to better illustrate your points.
Zoom etiquette is straightforward: all participants will be muted except the lecturer. Feel free to ask questions via chat, which we’ll monitor regularly. During class, labs, and homework attempts, post questions and comments the Stata-focused discussion community on GitHub for peer reference. While we aim to record lectures, live attendance is recommended when possible.
Regarding academic integrity, we encourage the use of small code snippets from books, the internet, or peers, provided they’re cited, as shown below:
tokenize `c(ALPHA)' // Adapted from https://www.statalist.org/forums/forum/general-stata-discussion/general/1380433-creating-a-counter-with-alphabets
Leveraging AI, including ChatGPT, as a co-pilot, guide, or assistant, is strongly encouraged both during and after this course. Learn more.
Table of Contents#
- 1. Philosophy, overview, commands, syntax
- 2. Return values, macros, programs
- 3. Loops, Program Syntax, and Miscellany
- 4. Basic file management, Programming options
- 5. Review of Weeks 1 - 4
- 6 Nested, Hierarchical, Multilevel, Longitudinal Data
- 7. Visualizing data in Stata
- 8.Survival Analysis: Non-parametric, Semi-parametric, Parametric
- Quick References