Stata: Set Up

Stata Windows

Introduction to Stata windows: restoring closed windows, personalizing window sizes, font sizes, and saving preferences.

There are 4 main windows in STATA

  1. Variables - Lists variables and labels. Double click on a variable in this window to paste it into the command window
  2. Command - Type in commands here
  3. Results - Displays results generated from commands
  4. Review - Keeps a history of all past commands executed. Click on a past command to paste it into the command window.

Value Labels

Exploring data layout, variable types, and use of variable and value labels

  • Variable labels give a fuller description of variables
  • Text variables stored in string format, numerical variables stores as int, float, byte, etc.
  • Store a variable with numerical value and attach text labels to each value by creating a value label and applying it to the variable

Dummy Variables from Categorical Var.

Dummy Variables for each category take values "0" or "1"

Stata: Data Management & Analysis

Tables and Cross Tabulation

One-way and two-way tables, incorporating missing data, and including relative frequencies

  • Tabulations best used for categorical variables

t-test for independent Samples

Two-group mean comparison test

  • Plotting graphs gives an idea of distributions of data
  • ttest gives results for one-tail and two-tail tests

Stata: Graphs

Using Graphs

Using Graphs to understand your data through histogram, scatterplot, and bar graph

  • Use graphs to compare statistics across categories

Customizing Graphs

Using the Graph Editor to customize labels, colour schemes, design, etc.

  • Saving graphs and pasting to Word documents
  • Generate separate graphs by category

Standardizing Graphs

Record and save customizations to generate a standard format for all your graphs

Stata: Regression Analysis

OLS: Ordinary Least Square Regression

Review of Ordinary Least Squares (OLS) simple linear regression and the constant coefficient

  • STATA generates the constant term by regressing on x=1

Multicollinearity & Reference Groups in an OLS Regression

Regressing with dummy variables and choosing a reference group

  • Generate dummies to capture different effects of each category
  • Choose one reference group (or constant) to omit to avoid multicollinearity
  • Coefficients measure effects relative to reference group