BASICS
1 Read this—it will help
- 1.1 Getting Started with Stata
- 1.2 The User's Guide and the Reference manuals
- 1.2.1 Sample datasets
- 1.2.2 Cross-referencing
- 1.2.3 The index
- 1.2.4 The subject table of contents
- 1.2.5 Typography
- 1.2.6 Vignettes
- 1.3 What's new
- 1.3.1 New matrix language
- 1.3.2 Survey statistics
- 1.3.3 Longitudinal/panel data
- 1.3.4 Time-series statistics
- 1.3.5 Multivariate statistics
- 1.3.6 Survival analysis
- 1.3.7 General-purpose statistics
- 1.3.8 New ML features
- 1.3.9 Functions and expressions
- 1.3.10 Data management
- 1.3.11 Graphics
- 1.3.12 User interface
- 1.3.13 Programming
- 1.3.14 Documentation
- 1.3.15 What's more
- 1.4 References
2 A brief description of Stata
3 Resources for learning and using Stata
- 3.1 Overview
- 3.2 The http://www.stata.com web site
- 3.3 The http://www.stata-press.com web site
- 3.4 The Stata listserver
- 3.5 The Stata Journal and the Stata Technical Bulletin
- 3.6 Updating and adding features from the web
- 3.6.1 Official updates
- 3.6.2 Unofficial updates
- 3.7 NetCourses
- 3.8 Books and other support materials
- 3.9 Technical support
- 3.9.1 Register your software
- 3.9.2 Before contacting technical support
- 3.9.3 Technical support by email
- 3.9.4 Technical support by phone or fax
- 3.9.5 Comments and suggestions for our technical staff
4 Stata's online help and search facilities
- 4.1 Introduction
- 4.2 help: Stata's online manual pages
- 4.3 search: Stata's online index
- 4.4 Accessing help and search from the Help menu
- 4.5 More on search
- 4.6 More on help
- 4.7 help contents: Stata's online table of contents
- 4.8 search: All the details
- 4.8.1 How search works
- 4.8.2 Author searches
- 4.8.3 Entry ID searches
- 4.8.4 FAQ searches
- 4.8.5 Return codes
- 4.9 net search: Searching net resources
5 Flavors of Stata
- 5.1 Platforms
- 5.2 Stata/SE, Intercooled Stata, and Small Stata
- 5.2.1 Determining which version you own
- 5.2.2 Determining which version is installed
- 5.3 Size limits comparison of Stata/SE, Intercooled Stata, and Small Stata
- 5.4 Speed comparison of Stata/SE, Intercooled Stata, and Small Stata
- 5.5 Features of Stata/SE
6 Setting the size of memory
- 6.1 Memory size considerations
- 6.2 Setting memory on the fly: Stata/SE
- 6.2.1 Advice on setting maxvar
- 6.2.2 Advice on setting matsize
- 6.2.3 Advice on setting memory
- 6.3 Setting memory size on the fly: Intercooled Stata
- 6.4 The memory command
- 6.5 Virtual memory and speed considerations
- 6.6 An issue when returning memory to Unix
7 -more- conditions
- 7.1 Description
- 7.2 set more off
- 7.3 The more programming command
8 Error messages and return codes
- 8.1 Makes mistakes
- 8.1.1 Mistakes are forgiven
- 8.1.2 Mistakes stop user-written programs and do-files
- 8.1.3 Advanced programming to tolerate errors
- 8.2 The return message for obtaining command timings
9 The Break key
- 9.1 Making Stata stop what it is doing
- 9.2 Side-effects of pressing Break
- 9.3 Programming considerations
10 Keyboard use
- 10.1 Description
- 10.2 F-keys
- 10.3 Editing keys in Stata for Windows, Macintosh, and Unix (GUI)
- 10.4 Editing keys in Stata for Unix (console)
- 10.5 Editing previous lines in Stata for all operating systems
- 10.6 Tab expansion of variable names
ELEMENTS
11 Language syntax
- 11.1 Overview
- 11.1.1 varlist
- 11.1.2 by varlist
- 11.1.3 if exp
- 11.1.4 in range
- 11.1.5 =exp
- 11.1.6 weight
- 11.1.7 options
- 11.1.8 numlist
- 11.1.9 datelist
- 11.1.10 Prefix commands
- 11.2 Abbreviation rules
- 11.2.1 Command abbreviation
- 11.2.2 Option abbreviation
- 11.2.3 Variable-name abbreviation
- 11.3 Naming conventions
- 11.4 varlists
- 11.4.1 Lists of existing variables
- 11.4.2 Lists of new variables
- 11.4.3 Time-series varlists
- 11.5 by varlist: construct
- 11.6 File-naming conventions
- 11.6.1 A Special note for Macintosh users
- 11.6.2 A special note for Unix users
12 Data
- 12.1 Data and datasets
- 12.2 Numbers
- 12.2.1 Missing values
- 12.2.2 Numberic storage types
- 12.3 Dates
- 12.4 Strings
- 12.4.1 Strings containing identifying data
- 12.4.2 Strings containing categorical data
- 12.4.3 Strings containing numeric data
- 12.4.4 String storage types
- 12.5 Formats: controlling how data are displayed
- 12.5.1 Numeric formats
- 12.5.2 European numeric formats
- 12.5.3 Date formats
- 12.5.4 Time-series formats
- 12.5.5 String formats
- 12.6 Dataset, variable, and value labels
- 12.6.1 Dataset labels
- 12.6.2 Variable labels
- 12.6.3 Value labels
- 12.6.4 Labels in other languages
- 12.7 Notes attached to data
- 12.8 Characteristics
13 Functions and expressions
- 13.1 Overview
- 13.2 Operators
- 13.2.1 Arithmetic operators
- 13.2.2 String operators
- 13.2.3 Relational operators
- 13.2.4 Logical operators
- 13.2.5 Order of evaluation, all operators
- 13.3 Functions
- 13.4 System variables (_variables)
- 13.5 Accessing coefficients and standard errors
- 13.5.1 Simple models
- 13.5.2 ANOVA and MANOVA models
- 13.5.3 Multiple-equation models
- 13.6 Accessing results from Stata commands
- 13.7 Explicit subscripting
- 13.7.1 Generating lags and leads
- 13.7.2 Subscripting within groups
- 13.8 Time-series operators
- 13.8.1 Generating lags and leads
- 13.8.2 Operators within groups
- 13.9 Label values
- 13.10 Precision and problems therein
14 Matrix expressions
- 14.1 Overview
- 14.1.1 Definition of a matrix
- 14.1.2 matsize
- 14.2 Row and column names
- 14.2.1 The purpose of row and column names
- 14.2.2 Three-part names
- 14.2.3 Setting row and column names
- 14.2.4 Obtaining row and column names
- 14.3 Vectors and scalars
- 14.4 Inputting matrices by hand
- 14.5 Accessing matrices created by Stata commands
- 14.6 Creating matrices by accumulating data
- 14.7 Matrix operators
- 14.8 Matrix functions
- 14.9 Subscripting
- 14.10 Using matrices in scalar expressions
15 Printing and preserving output
- 15.1 Overview
- 15.1.1 Starting and closing logs
- 15.1.2 Appending to an existing log
- 15.1.3 Temporarily suspending and resuming logging
- 15.2 Placing comments in logs
- 15.3 Logging only what you type
- 15.4 The log-button alternative
- 15.5 Printing logs
16 Do-files
- 16.1 Description
- 16.1.1 Version
- 16.1.2 Comments and blank lines in do-files
- 16.1.3 Long lines in do-files
- 16.1.4 Error handling in do-files
- 16.1.5 Logging the output of do-files
- 16.1.6 Preventing -more- conditions
- 16.2 Calling other do-files
- 16.3 Running a do-file (Stata for Windows)
- 16.4 Running a do-file (Stata for Macintosh)
- 16.5 Running a do-file (Stata for Unix)
- 16.6 Programming with do-files
- 16.6.1 Argument passing
- 16.6.2 Suppressing output
17 Ado-files
- 17.1 Description
- 17.2 What is an ado-file?
- 17.3 How can I tell if a command is built in or an ado-file?
- 17.4 Can I look at an ado-file?
- 17.5 Where does Stata look for ado-files?
- 17.5.1 Where are the official ado directories?
- 17.5.2 Where is my personal ado directory?
- 17.6 How do I install an addition?
- 17.7 How do I add my own ado-files?
- 17.8 How do I install official updates?
18 Programming Stata
- 18.1 Description
- 18.2 Relationship between a program and a do-file
- 18.3 Macros
- 18.3.1 Local macros
- 18.3.2 Global macros
- 18.3.3 The difference between local and global macros
- 18.3.4 Macros and expressions
- 18.3.5 Double quotes
- 18.3.6 Extended macro functions
- 18.3.7 Macro increment and decrement functions
- 18.3.8 Macro expressions
- 18.3.9 Advanced local macro manipulation
- 18.3.10 Advanced global macro manipultation
- 18.3.11 Constructing Windows filenames using macros
- 18.3.12 Accessing system values
- 18.3.13 Referencing characteristics
- 18.4 Program arguments
- 18.4.1 Named positional arguments
- 18.4.2 Incrementing through positional arguments
- 18.4.3 Using macro shift
- 18.4.4 Parsing standard Stata syntax
- 18.4.5 Parsing immediate commands
- 18.4.6 Parsing nonstandard syntax
- 18.5 Scalars and matrices
- 18.6 Temporarily destroying the data in memory
- 18.7 Temporary objects
- 18.7.1 Temporary variables
- 18.7.2 Temporary scalars and matrices
- 18.7.3 Temporary files
- 18.8 Accessing results calculated by other programs
- 18.9 Accessing results calculated by estimation commands
- 18.10 Saving results
- 18.10.1 Saving results in r()
- 18.10.2 Saving results in e()
- 18.10.3 Saving results in s()
- 18.11 Ado-files
- 18.11.1 Version
- 18.11.2 Comments and long lines in ado-files
- 18.11.3 Debugging ado-files
- 18.11.4 Local subroutines
- 18.11.5 Development of a sample ado-command
- 18.11.6 Writing online help
- 18.12 A compendium of useful commands for programmers
- 18.13 References
19 Immediate commands
- 19.1 Overview
- 19.1.1 Examples
- 19.1.2 A list of the immediate commands
- 19.2 The display command
20 Estimation and postestimation commands
- 20.1 All estimation commands work the same way
- 20.2 Standard syntax
- 20.3 Replaying prior results
- 20.4 Cataloging estimation results
- 20.5 Specifying the estimation subsample
- 20.6 Specifying the width of confidence intervals
- 20.7 Obtaining the variance–covariance matrix
- 20.8 Obtaining predicted values
- 20.8.1 Using predict
- 20.8.2 Making in-sample predictions
- 20.8.3 Making out-of-sample predictions
- 20.8.4 Obtaining standard errors, tests, and confidence intervals for predictions
- 20.9 Accessing estimated coefficients
- 20.10 Performing bypothesis tests on the coefficients
- 20.10.1 Linear tests
- 20.10.2 Using test
- 20.10.3 Likelihood-ratio tests
- 20.10.4 Nonlinear Wald tests
- 20.11 Obtaining linear combinations of coefficients
- 20.12 Obtaining nonlinear combinations of coefficients
- 20.13 Obtaining marginal effects
- 20.14 Obtaining robust variance estimates
- 20.15 Obtaining scores
- 20.16 Weighted estimation
- 20.16.1 Frequency weights
- 20.16.2 Analytic weights
- 20.16.3 Sampling weights
- 20.16.4 Importance weights
- 20.17 A list of postestimation commands
- 20.18 References
ADVICE
21 Overview
- 21.1 Inputting data
- 21.2 Determining which input method to use
- 21.2.1 Entering data interactively
- 21.2.2 If the dataset is in binary format
- 21.2.3 If the data are simple
- 21.2.4 If the dataset is formatted and the formatting is significant
- 21.2.5 If there are no string variables
- 21.2.6 If all the string variables are enclosed in quotes
- 21.2.7 If the undelimited strings have no blanks
- 21.2.8 If you make it to here
- 21.3 If you run out of memory
- 21.4 Transfer programs
- 21.5 ODBC sources
- 21.6 References
22 Combining datasets
23 Dealing with strings
- 23.1 Description
- 23.2 Categorical string variables
- 23.3 Mistaken string variables
- 23.4 Complex strings
- 23.5 Reference
24 Dealing with dates
- 24.1 Overview
- 24.2 Dates
- 24.2.1 Inputting dates
- 24.2.2 Conversion into elapsed dates
- 24.2.2.1 The mdy() function
- 24.2.2.2 The date() function
- 24.2.3 Displaying dates
- 24.2.4 Other date functions
- 24.2.5 Specifying particular dates (date literals)
- 24.3 Time-series dates
- 24.3.1 Inputting time variables
- 24.3.2 Specifying particular dates (date literals)
- 24.3.3. Time-series format
- 24.3.4 Translating between time units
- 24.3.5 Extracting components of time
- 24.3.6 Creating time variables
- 24.3.7 Setting the time variable
- 24.3.8 Selecting periods of time
- 24.3.9 The %tg format
25 Dealing with categorical variables
- 25.1 Continuous, categorical, and indicator variables
- 25.1.1 Converting continuous variables to indicator variables
- 25.1.2 Converting continuous variables to categorical variables
- 25.1.3 Converting categorical variables to indicator variables
- 25.2 Using indicator variables in estimation
- 25.2.1 Testing the significance of indicator variables
- 25.2.2 Importance of omitting one of the indicators
26 Overview of Stata estimation commands
- 26.1 Introduction
- 26.2 Linear regression with simple error structures
- 26.3 ANOVA, ANCOVA, MANOVA, and MANCOVA
- 26.4 Generalized linear models
- 26.5 Binary-outcome qualitative dependent variable models
- 26.6 Conditional logistic regression
- 26.7 Multiple-outcome qualitative dependent variable models
- 26.8 Simple count dependent variable models
- 26.9 Linear regression with heteroskedastic errors
- 26.10 Stochastic frontier models
- 26.11 Linear regression with systems of equations (correlated errors)
- 26.12 Models with endogenous sample selection
- 26.13 Models with time-series data
- 26.14 Panel-data models
- 26.14.1 Linear regression with panel data
- 26.14.2 Censored linear regression with panel data
- 26.14.3 Generalized linear models with panel data
- 26.14.4 Qualitative dependent-variable models with panel data
- 26.14.5 Count dependent-variable models with panel data
- 26.14.6 Random-coefficient models with panel data
- 26.15 Survival-time (failure-time) models
- 26.16 Survey data
- 26.17 Multivariate and cluster analysis
- 26.18 Pharmacokinetic data
- 26.19 Specification search tools
- 26.20 Obtaining new estimation commands
- 26.21 Reference
27 Commands everyone should know
- 27.1 Forty-one commands
- 27.2 The by construct
28 Using the Internet to keep up to date
- 28.1 Overview
- 28.2 Sharing datasets (and other files)
- 28.3 Official updates
- 28.3.1 Example
- 28.3.2 Updating ado-files
- 28.3.3 Frequently asked questions about updating the ado-files
- 28.3.4 Updating the executable
- 28.3.5 Frequently asked questions about updating the executable
- 28.3.6 Updating both ado-files and the executable
- 28.4 Downloading and managing additions by users
- 28.4.1 Downloading files
- 28.4.2 Managing files
- 28.4.3 Finding files to download
- 28.5 Making your own download site
Subject and author index (pdf)