After opening Stata for the first time: set scheme s1mono, permanently

Similar documents
1. Basic Steps for Data Analysis Data Editor. 2.4.To create a new SPSS file

STATA 13 INTRODUCTION

Instructions for Using ABCalc James Alan Fox Northeastern University Updated: August 2009

Stata version 13. First Session. January I- Launching and Exiting Stata Launching Stata Exiting Stata..

The first few questions on this worksheet will deal with measures of central tendency. These data types tell us where the center of the data set lies.

Econ Stata Tutorial I: Reading, Organizing and Describing Data. Sanjaya DeSilva

Basic Stata Tutorial

Applied Regression Modeling: A Business Approach

Dr. Barbara Morgan Quantitative Methods

Math 227 EXCEL / MEGASTAT Guide

Excel Tips and FAQs - MS 2010

Stata v 12 Illustration. First Session

Introduction to STATA

Introduction to the workbook and spreadsheet

Introduction to Stata Toy Program #1 Basic Descriptives

International Graduate School of Genetic and Molecular Epidemiology (GAME) Computing Notes and Introduction to Stata

I Launching and Exiting Stata. Stata will ask you if you would like to check for updates. Update now or later, your choice.

Chapter 2 Assignment (due Thursday, April 19)

Quick Start Guide Jacob Stolk PhD Simone Stolk MPH November 2018

AcaStat User Manual. Version 8.3 for Mac and Windows. Copyright 2014, AcaStat Software. All rights Reserved.

Applied Regression Modeling: A Business Approach

IT 403 Practice Problems (1-2) Answers

A Short Guide to Stata 10 for Windows

One does not necessarily have special statistical software to perform statistical analyses.

An Introductory Guide to Stata

BIOSTATISTICS LABORATORY PART 1: INTRODUCTION TO DATA ANALYIS WITH STATA: EXPLORING AND SUMMARIZING DATA

Dealing with Data in Excel 2013/2016

Lab 19: Excel Formatting, Using Conditional Formatting and Sorting Records

Microsoft Excel Using Excel in the Science Classroom

Bluman & Mayer, Elementary Statistics, A Step by Step Approach, Canadian Edition

Your Name: Section: INTRODUCTION TO STATISTICAL REASONING Computer Lab #4 Scatterplots and Regression

Basics: How to Calculate Standard Deviation in Excel

Minitab 17 commands Prepared by Jeffrey S. Simonoff

Statistical Package for the Social Sciences INTRODUCTION TO SPSS SPSS for Windows Version 16.0: Its first version in 1968 In 1975.

Survey of Math: Excel Spreadsheet Guide (for Excel 2016) Page 1 of 9

THE LINEAR PROBABILITY MODEL: USING LEAST SQUARES TO ESTIMATE A REGRESSION EQUATION WITH A DICHOTOMOUS DEPENDENT VARIABLE

Introduction to Stata

8: Statistics. Populations and Samples. Histograms and Frequency Polygons. Page 1 of 10

Total Number of Students in US (millions)

The Menu and Toolbar in Excel (see below) look much like the Word tools and most of the tools behave as you would expect.

Introduction (SPSS) Opening SPSS Start All Programs SPSS Inc SPSS 21. SPSS Menus

Regression on SAT Scores of 374 High Schools and K-means on Clustering Schools

Table of Contents (As covered from textbook)

Homework 1 Excel Basics

Introduction to Stata - Session 2

Advanced Regression Analysis Autumn Stata 6.0 For Dummies

Exploring Data. This guide describes the facilities in SPM to gain initial insights about a dataset by viewing and generating descriptive statistics.

Math 121 Project 4: Graphs

Revision of Stata basics in STATA 11:

Chapter 2 Assignment (due Thursday, October 5)

1 Introduction to Using Excel Spreadsheets

Part I, Chapters 4 & 5. Data Tables and Data Analysis Statistics and Figures

Data Analysis and Solver Plugins for KSpread USER S MANUAL. Tomasz Maliszewski

Statistics with a Hemacytometer

Introduction to Excel Workshop

Excel Spreadsheets and Graphs

Project 11 Graphs (Using MS Excel Version )

You will learn: The structure of the Stata interface How to open files in Stata How to modify variable and value labels How to manipulate variables

Using Large Data Sets Workbook Version A (MEI)

Measures of Dispersion

Chapter 1. Looking at Data-Distribution

Rockefeller College MPA Excel Workshop: Clinton Impeachment Data Example

MINITAB 17 BASICS REFERENCE GUIDE

Research Methods for Business and Management. Session 8a- Analyzing Quantitative Data- using SPSS 16 Andre Samuel

Excel Primer CH141 Fall, 2017

In Minitab interface has two windows named Session window and Worksheet window.

A Quick Guide to Stata 8 for Windows

ECO375 Tutorial 1 Introduction to Stata

Exploring extreme weather with Excel - The basics

THE AMERICAN LAW INSTITUTE Continuing Legal Education

Using the DATAMINE Program

Introduction to Minitab 1

SPSS for Survey Analysis

Spreadsheet Warm Up for SSAC Geology of National Parks Modules, 2: Elementary Spreadsheet Manipulations and Graphing Tasks

Brief Guide on Using SPSS 10.0

Excel R Tips. is used for multiplication. + is used for addition. is used for subtraction. / is used for division

Introduction to Stata First Session. I- Launching and Exiting Stata Launching Stata Exiting Stata..

Introduction to STATA

Chapter One: Getting Started With IBM SPSS for Windows

Lab 7 Statistics I LAB 7 QUICK VIEW

A quick introduction to STATA

EXCEL 2007 TIP SHEET. Dialog Box Launcher these allow you to access additional features associated with a specific Group of buttons within a Ribbon.

A cell is highlighted when a thick black border appears around it. Use TAB to move to the next cell to the LEFT. Use SHIFT-TAB to move to the RIGHT.

MAT 142 College Mathematics. Module ST. Statistics. Terri Miller revised July 14, 2015

Chapter 6: DESCRIPTIVE STATISTICS

Opening a Data File in SPSS. Defining Variables in SPSS

Pivot Tables, Lookup Tables and Scenarios

SPSS. (Statistical Packages for the Social Sciences)

INTRODUCTION TO SPSS OUTLINE 6/17/2013. Assoc. Prof. Dr. Md. Mujibur Rahman Room No. BN Phone:

Averages and Variation

เพ มภาพตามเน อหาของแต ละบท. Microsoft Excel Benjamas Panyangam and Dr. Dussadee Praserttitipong. Adapted in English by Prakarn Unachak

CHAPTER 2: SAMPLING AND DATA

Microsoft Office Excel

Economics 145 Fall 2009 Howell Getting Started with Stata

Principles of Biostatistics and Data Analysis PHP 2510 Lab2

HPOG RoundTable: How to Manipulate PAGES Data with Excel

Empirical Asset Pricing

Further Maths Notes. Common Mistakes. Read the bold words in the exam! Always check data entry. Write equations in terms of variables

Gloucester County Library System EXCEL 2007

Acquisition Description Exploration Examination Understanding what data is collected. Characterizing properties of data.

Transcription:

Stata 13 HELP Getting help Type help command (e.g., help regress). If you don't know the command name, type lookup topic (e.g., lookup regression). Email: tech-support@stata.com. Put your Stata serial # in the subject line of the email. STARTING AND QUITING STATA To start Double-click on the Stata icon or on a Stata dataset. To quit Stata menu à Quit Stata (or C-Q). SETTING THE "SCHEME" After opening Stata for the first time: set scheme s1mono, permanently COMMANDS Use commands rather than point-and-click Nearly everything in Stata can be done via the menus. But you're better off typing commands into a word processing file and saving them, then cutting-and-pasting them into the Stata "Command" window. How to enter commands in the "Command" window Type the command or paste it in; then Enter. To repeat an earlier command without having to retype it: Look at the list of your previous commands in the "Review" window and click on the one you want; then Enter. DATA FILES Creating and opening data files To create a new data file: Click on the "Data Editor" toolbar button.

- 2 - To get into an existing data file: Click on the "Open" toolbar button (or File menu à Open) and select the file. Saving a data file To save a data file: Exit the data editor by clicking on the X in the upper-left corner of the Stata screen, then File menu à Save (or C-S). The extension for Stata data files is.dta. Entering data Type it in manually: In a Stata data file, type the datum in the appropriate cell, then Enter (or one of the arrow keys). Copy and paste from an Excel file: In Excel, highlight the cells you want; then Edit menu à Copy (or C-C); then in the Stata Data Editor, put the cursor in the upper-left cell and Edit menu à Paste (or C-V). To change a string variable into a numeric variable destring variablename, replace Listing data list variablename1 variablename2 variablename3 (option clean leaves out table lines) Variable names and labels Variable names: Click on the variable name. Variable names must begin with a letter; they can't begin with a number. Stata is case sensitive: race is different from Race or RACE. Variable names can't include a dash; use an underscore instead. Variable labels: Click on the variable name. Variable format: Click on the variable name. %8.2g indicates that the variable can stretch for 8 characters, 2 of which follow the decimal point. %8.0gc indicates that a comma will display. Value labels: Type label define race 1 "white" 2 "black" 3 "other" and then Enter. Then type label values race race and Enter. Creating a new variable To create a new variable: generate variablename = operation (e.g., generate unionization_sqr = unionization^2). Once you execute this command, Stata creates the new variable and adds it to the data set. For any recomputations, use the replace command instead of generate. To create a new variable that corresponds to observation numbers (i.e., 1, 2, 3, etc.): generate variablename=_n. Recoding a variable To recode a variable: First make a copy of the variable: generate race2 = race. Then recode race2 3=0 2=1 1=2. To recode a value into a missing value: recode race 3=. (3=dot).

- 3 - An alternative to the recode command is the replace command: First generate income2=income. Then replace income2=1 if income<=10000. Then replace income2=2 if income>10000. Ordering variables and cases To reorder variables in the data file: order city stateabbr year population will put those variables, in the order listed, at the beginning of the data set. Options for the order command include alphabetic, before(), after(), first, last. To reorder cases in the data file: sort city year. OUTPUT Pasting output into a word processing document In the "Results" window, highlight the output you want to copy; then Edit menu à Copy (or C-C). In the word processing document, put the cursor where you want the results to appear; then Edit menu à Paste (or C-V). Printing output To print from the Results window: Highlight the output you want to print; then click on the "Print" toolbar button (or C-P). CONDITIONAL EXPRESSIONS, OPERATORS Conditional expressions IF command: command if expression. For example: regress income educ age agesq if race==2. BY command: by variablename: command. For instance: by race: regress income educ age agesq. Operators and functions and: & or: equals: == does not equal: ~= greater than or equal to: >= less than or equal to: <= addition: + subtraction: multiplication: * division: / to the power of: ^ square root: sqrt(variablename)

- 4 - GRAPHS Histogram histogram variablename, percent bin(numberofdesiredbars). The percent option requests that relative frequencies, rather than counts, be displayed on the vertical axis. The bin option tells Stata the number of bars you want. For example: graph income, percent bin(8). Line graph To add a loess curve: scatter variablename year, connect(direct). Scatterplot scatter yvariablename xvariablename To add a regression line: scatter yvariablename xvariablename lfit yvariablename xvariablename, connect(direct). To add a loess curve: scatter yvariablename xvariablename lowess yvariablename xvariablename, connect(direct). To spread out data points that otherwise would lie on top of each other and thus be undecipherable: scatter yvariablename xvariablename, jitter(number). A good jitter number to start with is 7. Scheme When first opening Stata, type set scheme s1mono, permanently. For other schemes, type help scheme. MISSING VALUES How to enter missing values Stata's recognized code for missing values is a period (.). Note, however, that Stata treats missing values as larger than nonmissing values, so beware when using the generate or if commands. It's probably best to leave missing values blank. STATISTICAL ANALYSIS Coefficient of variation summarize variablename display r(sd) / r(mean) Correlation correlate variablename1 variablename2 variablename3 For pairwise deletion: pwcorr variablename1 variablename2 variablename3

- 5 - Crosstabs tabulate rowvariablename columnvariablename, column. The column option requests column percentages. Usually with crosstabs we put the (presumed) y variable as the row variable and the x variable as the column variable, and then examine the column percentages. Descriptive statistics summarize variablename. Shows mean, standard deviation, smallest value, largest value. summarize variablename, detail. In addition to mean etc., this shows the median (50th percentile), some other percentiles (1st, 5th, 10th, 25th, 75th, 90th, 95th, 99th), variance, skewness statistic, kurtosis statistic. Frequency distribution tab1 variablename1 variablename2 variablename3 Regression (OLS) regress yvariablename x1variablename x2variablename The option beta shows standardized coefficients. The option robust adds heteroskedasticity-consistent standard errors. The option level(80) shows 80% confidence intervals for coefficients (default is 95). Skewness statistic summarize variablename, detail Z-score (standardized score) summarize variablename generate variablename_zscore = (variablename r(mean)) / r(sd) UPDATING STATA VIA THE WEB In the "Command" window, type update all