# Stata/Introduction

Stata
* Basics
** Introduction
** Settings
** Documentation
** Probability Function
** Random Number Generation
** Data Management
** Graphics
** Programming
** Mata
** Natural Language Processing
** Publication Quality Output
** Descriptive Statistics
* Methods
** Maximum Likelihood
** Bayesian Methods
** Bootstrap
** Non Parametric
** Matching
** Quantile Regression
* Topics
** Linear Models
** Binomial Outcome Models
** Multinomial Models
** Count Data Models
** Tobit and Selection Models
** Duration Analysis
** Multilevel Modeling
** Time Series
** Spatial Econometrics
** Factor Analysis
* Problems

## Why use Stata ?

* It includes the very latest methods in econometrics
* It is a portable software (ie you can install it on your USB stick)
* It is widely used in economics/econometrics.
* It is commercial but it can utilize user-written functions.
* It has a nice Graphical User Interface

## Stata Basics

Stata Windows
* Command
* Review
* Variables
* Variables Manager
* Results
* Data Editor
* Data browser
* Graph editor
* Do-file editor

### Main Windows

* All the results appears in the Results window.
* The Command window can be used to interactively give instructions to Stata. This is an alternative to using the dialog boxes accessed via Stata drop-down menus or running Stata in batch mode using a do-file or ado-file.
* The Variables window lists all variables and labels of the dataset in memory. You can click on the name of a variable and it appears in the command window.
* The Variables Manager allows the user to quickly view and edit all the variable names, variable labels, formats, value labels, and notes.
* The Review window shows a list of past instructions. It can be useful if you want to quickly do things again. You just have to click on an instruction and it will appear again in the command window.
* You can also have a look at your data by typing in the command window -browse- or -edit-.
** -edit- allow you to change your datasets by hand, exactly as in excel. However this is not recommanded.
** -browse- may be a safer option. If you want to have a look at a specific list of variables, you can specify it to Stata by typing in the command window :
* The viewer window displays any SMCL (Stata Markup Control Language) file, such as help documentation.
* The do-file editor allows users to create and edit do-files and ado-files.

### Keyboard shortcuts

* Ctrl + D : do a program (selected text or whole do file)
* ⌘ + Shift + D : do a program (Mac OS 10+)

### Basic commands

* -help- (or -h-) : gives the help file of a command in a Viewer window.
* -search- : search local help files for a keyword.
* -findit- : search a keyword across local and net-based files.
* -cd- : change working directory
* -pwd- : displays the print working directory.
* -dir- or -ls- : list all the files in the working directory

### Stata Do-files

The command -doedit- opens a new do-file editor.

## Stata Programming Style

* Most command can be abbreviated. For instance:
** g or gen stands for generate
** h for help
** su for summarize
** gr for graph
** sc for scatter
** etc
* No brackets
* * at the beginning of a line stands for comment
* Stata is case sensitive.