ABSTRACT

This book is an introductory guide to programming and coding in Stata. Commonly encountered code in the field of medical statistics as well as the analyses of observational data are presented.

For those who are involved in the analyses of observational studies, the need to sometimes assemble large datasets will necessitate a detailed understanding of loops and macros. This book covers these materials early on and then describes other commonly required coding commands.

For those who program in a controlled environment (.e.g. medical statisticians who perform analyses for regulatory bodies), the production of log files, a suggested folder structure and analysis pathway are covered. This book also includes a wide range of tabulation commands and other methods of producing tables of descriptive statistics. The text also then provides a clear explanation of how to perform some inferential analyses (including how to extract and format the coefficients for use in subsequent reports).

The focus on coding allows beginners to grasp the basics of coding and programming, as well as allowing established researchers to hone their skills and become more advanced programmers.

Key Features:

  • Covers the fundamental of using and understanding Stata.
  • Able to be used by anyone looking to learn the basics of coding.
  • Introduces and explains difficult concepts such as macros from the outset.

chapter Chapter 1|5 pages

Introduction

chapter Chapter 2|5 pages

Temporary Names, Variables and Files

chapter Chapter 3|33 pages

Macros and Other Data Storage Mechanisms Used by Stata

chapter Chapter 5|8 pages

Loops

chapter Chapter 6|7 pages

Append, Merge and Collapse

chapter Chapter 7|5 pages

Reshape

chapter Chapter 8|5 pages

Dates

chapter Chapter 9|17 pages

Bits and Bobs

chapter Chapter 10|15 pages

Helpful Hints When Doing Regression

chapter Chapter 11|3 pages

Time Series Operators and Survival Analyses

chapter Chapter 12|2 pages

Exporting Output

chapter Chapter 13|11 pages

Stata Programming

chapter Chapter 14|16 pages

Tables of Baseline Characteristics

chapter Chapter 15|3 pages

Automated Reporting

chapter Chapter 16|8 pages

pretty_suite Packages for Easy Tables

chapter Chapter 17|13 pages

Tables with Output from Statistical Tests