Introduction to Stata: An In-class Tutorial

Size: px
Start display at page:

Download "Introduction to Stata: An In-class Tutorial"

Transcription

1 Introduction to Stata: An I. The Basics - Stata is a command-driven statistical software program. In other words, you type in a command, and Stata executes it. You can use the drop-down menus to avoid typing in commands, but that won t be a long-term solution because you will want to learn most commands in order to create do files (described below). If you use a command from a drop-down menu, Stata will print out the words you could have typed to execute it without the menu. This is one way to learn the commands (but not the recommended way, as sometimes those drop-down commands There are other statistical packages similar to Stata. Once you learn one, it is very easy to learn another. - You ve heard about Stata s advantages. Here are some of its drawbacks The most obvious is the need to learn a new language Stata s GUI interface is good, but not as good as most Windows apps Stata s graphics get better with each version, but Excel graphs are easier to format and create The Stata help can be frustrating, because you usually need to know the command name to get help using it. I have posted a file to the course page with a list of frequently used Stata commands. II. The First Time - Configure Stata Windows The first time you start Stata, you will see a number of windows that fill up only part of your desktop. You will want to resize and relocate the various windows. If you make changes to the windows, Stata will default to these changes the next time you start up. You can also change fonts by right clicking in each window. If you want to save a particular window configuration for future use, you can click Edit, Preferences, Save Preference Set, New Preference Set. You can then load this windowing configuration by going through the same menu. To allow you to scroll back and look at a longer history of results, click Edit, Preferences, General Preferences, Windowing and enter 500 (or 50000) in the first box (see screen shot below) 1

2 - Icons We ll go through those I have labeled by the end of the tutorial. - (Optional) set matsize yyy, where yyy is the number of variables you are going to use in a regression. (e.g. set at 500). This is optional. You should not need this unless you are working with hundreds of variables. More expensive versions of Stata permit larger limits. 2

3 III. Opening, Manipulating, and Saving Data Files - Stata permits you to invoke limited DOS commands. Though they are archaic, it is useful to learn a few. cd d:\decs431 (to change the working directory) dir (to list out the contents of a folder) pwd (to see the current path and folder) You can also go to File, Change Working Directory to locate the directory you want. I find it useful to change my default folder to the one that holds my data set. You can change Stata s default working directory by right-clicking on the Stata icon in your program directory, then selecting Properties, Shortcut. Enter the directory in which you want Stata to start, e.g. d:\decs431 - Opening Stata Data Files Stata can only work with Stata data files, which have the suffix.dta Just as with other software, there are several options for opening a Stata data file. One nice option is to go to the File menu and select Recent Datasets. Another option is to type a Stata command, telling Stata to use a particular file. The syntax for the command is use path\filename For example, on my laptop I have a file autosales.dta that resides in my d:\decs431 folder. To open that file, I have two command choices: use d:\decs431\autosales or cd d:\decs431 followed by use autosales Note: When referring to path names with spaces (e.g., d:\my path\file name), you must use quotation marks (e.g. d:\my path\file name ) The file autosales.dta is now our active dataset. Note how these (and all other) commands appear in the Review window. You can press the page up or page down keys to access past commands. Alternatively, you can click on past commands in the Review window. - Examine your data You can re-enter a command by clicking on it. If you don t want to type variable names, you can click on them. describe will describe the data: you get the name and size of the file, number of observations, variable names and labels, and the storage type for each variable (string or various numerical types) You can provide labels (brief descriptions) for your variables using label variable command. These labels appear when you use the describe command. Try label var month "Month of Sale". It is a 3

4 good idea to label every variable in your data unless the variable name is fully self-explanatory. 1 Another way to look at variables is using codebook. This gives much more detail but can take significant computer time on large datasets. A useful alternative is codebook, compact You can eyeball the data in their rows and columns and make changes to specific observations - by clicking on the edit button. The browse icon lets you look, but doesn t let you edit the data. You can also examine your data by typing list var1 var2 (fill in the variables you want to explore). If you only want to see observations in rows m through n, type list var1 var2 in m/n. (E.g., to see the first 10 rows, type list var1 var2 in 1/10.) You can get summary statistics, tabulations, and correlations summarize odometer (gives the mean, std. dev., range, and sample size) summarize odometer, detail (same as above, plus median and other percentiles of the distribution as well as outliers) histogram odometer (produces histogram) tab year (to get all values and their percentiles) corr year odometer (for a simple correlation matrix) pwcorr year odometer, sig (to obtain significance levels for the correlations) - Saving your data You can use the GUI interface: simply click the Save icon You can type save autosales2. Always keep an unchanged version of the original data. IV. Brief Summary of Stata Syntax - Stata has a few predetermined ways of entering commands. Once you learn them it will be very easy to learn new commands. The basic syntax are: Basic Syntax 1: command variable1 variable2 variablen summarize odometer year Basic Syntax 2: command variable1 variablen if logical expression summarize odometer year if odometer>30000 The if operators are: if a == b (two equals signs): if a equals b if a > b: if a is greater than b if a < b: if a is less than b 1 Variable names may be 1 to 32 characters long, and must start with a-z, A-Z, or _, and the remaining characters may be a-z, A-Z, _, or 0-9. When referring to an existing varname, we can abbreviate -- use only some of the leading characters -- as long as we specify enough to uniquely identify the variable: Myv might be a unique abbreviation for Myvar. (Excerpted from the Stata Reference Manual). 4

5 if a >= b: if a is greater than or equal to b if a <= b: if a is less than or equal to b if a ~= b: if a does not equal b You can combine two or more of these statements with the logical AND ( &) or the logical OR ( ). Be sure to use the correct parentheses as needed! The if operator works row by row, just like in excel. It executes the command only for the rows in which the conditional is true. Basic Syntax 3: command variable1 variablen in value1 / value2 summarize odometer year in 5/10 list odometer year in 5/10 similar to the if command. Executes the command for all rows between value1 and value2. Signals error if value1 is greater than value2. Basic Syntax 4: command variable1 variablen, options summarize odometer year, detail Different commands have different options. You will get to know the most useful options as we go along. The comma (, ) separates the command line from the options. The options are always the last thing in a command line. For example, the following is valid: summarize odometer year if price>10000, detail This is NOT valid: summarize odometer year, detail if price>10000 Alternative Syntax: (we ll go over them again, no need to memorize them) DOS commands: dir cd directory erase filename Stata control commands: do filename edit clear use filename set parameter value Remember, if you forget how to write something, you can always find it in the drop down menus or by typing help command V. Keeping Track of What You Have Done - One way is to click on the print icon. This will waste a bunch of paper. - I strongly urge you to create a Stata log a separate file containing all your work. Here s how to create a log file. Click on the log button. This opens a familiar save file type window. Save the file as type Log (DO NOT USE the.smcl default) Alternatively, you can type log using mylogfile.log 5

6 - Stata will save a record of your work in a text file. You can edit and print this record using MS Word or Wordpad. - You can temporarily stop the log file by typing log off and restart it by typing log on. In this way, you can avoid clogging up the log with unnecessary stuff. Type log close to end your log file. - You can place comments in your log by placing an asterisk (*) before the Stata command line Stata will not execute lines beginning with * - To print the log file from within Stata, click on the log button again and select View snapshot of log file. Your log file will appear in a separate window. VI. The Do File editor The Do file editor is a document editor where you write the commands as if you were writing them directly in the command line. It helps keep track of your work. You can re-run any segment by highlighting it with the mouse and clicking one of the two execute buttons. If you click the execute buttons without highlighting anything the whole document will be executed. 6

7 Execution stops if an error is generated. For example, if you try to create a variable that already exists. Each command must be on a separate line. Use * at the beginning of a line to insert comments. That line will not be executed. Use // as the end of a line to insert comments. The rest of the line will not be executed. VII. Creating Variables - Suppose you want a variable that equals the percentage of the population in the PMSA that is out of the workforce, e.g. the young and the old. Just pick a variable name (say, ageatsale ) and use the generate, or gen command: gen ageatsale = year-modelyear Note missing values are recorded as. Stata usually ignores these values. More on this later. - Use replace to change values of an existing variable (e.g. replace ageatsale=ageatsale*12) - Use the rename command to change the name of a variable. Alternatively, you can right click the variable in the Variables box. - Use the if option to execute any command on a subset of observations. For example: replace ageatsale=0 if ageatsale<0 - Dummy variables: These are variables that equal one for some observations and zero for others. These can be used to designate mutually exclusive and exhaustive groups. For example: build a variable for saturated hospitals and unsaturated hospitals: For example: generate mileagehigh = (odometer>40000). Let s see if it worked: sum mileagehigh WARNING: when it comes to evaluating if statements, Stata treats missing values as equaling positive infinity. Safe way to execute above command: generate mileagehigh = (odometer>40000) if!missing(odometer) Use drop command to get rid of variables: drop mileagehigh 7

8 VIII. Estimating a Regression - Suppose you want to estimate the following model price = B 0 + B 1 ageatsale + B 2 odometer - Just type reg price ageatsale odometer - Or, type regress and then click on the variables in the Variables window. We will learn what all of the output means as the course progresses. reg price ageatsale odometer Source SS df MS Number of obs = F( 2, 49997) =. Model e e+11 Prob > F = Residual e R-squared = Adj R-squared = Total e Root MSE = price Coef. Std. Err. t P> t [95% Conf. Interval] ageatsale odometer _cons

/23/2004 TA : Jiyoon Kim. Recitation Note 1

/23/2004 TA : Jiyoon Kim. Recitation Note 1 Recitation Note 1 This is intended to walk you through using STATA in an Athena environment. The computer room of political science dept. has STATA on PC machines. But, knowing how to use it on Athena

More information

A Short Introduction to STATA

A Short Introduction to STATA A Short Introduction to STATA 1) Introduction: This session serves to link everyone from theoretical equations to tangible results under the amazing promise of Stata! Stata is a statistical package that

More information

Dr. Barbara Morgan Quantitative Methods

Dr. Barbara Morgan Quantitative Methods Dr. Barbara Morgan Quantitative Methods 195.650 Basic Stata This is a brief guide to using the most basic operations in Stata. Stata also has an on-line tutorial. At the initial prompt type tutorial. In

More information

Getting started with Stata 2017: Cheat-sheet

Getting started with Stata 2017: Cheat-sheet Getting started with Stata 2017: Cheat-sheet 4. september 2017 1 Get started Graphical user interface (GUI). Clickable. Simple. Commands. Allows for use of do-le. Easy to keep track. Command window: Write

More information

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

Econ Stata Tutorial I: Reading, Organizing and Describing Data. Sanjaya DeSilva Econ 329 - Stata Tutorial I: Reading, Organizing and Describing Data Sanjaya DeSilva September 8, 2008 1 Basics When you open Stata, you will see four windows. 1. The Results window list all the commands

More information

Bivariate (Simple) Regression Analysis

Bivariate (Simple) Regression Analysis Revised July 2018 Bivariate (Simple) Regression Analysis This set of notes shows how to use Stata to estimate a simple (two-variable) regression equation. It assumes that you have set Stata up on your

More information

Introduction to Stata Toy Program #1 Basic Descriptives

Introduction to Stata Toy Program #1 Basic Descriptives Introduction to Stata 2018-19 Toy Program #1 Basic Descriptives Summary The goal of this toy program is to get you in and out of a Stata session and, along the way, produce some descriptive statistics.

More information

Introduction to STATA

Introduction to STATA Center for Teaching, Research and Learning Research Support Group American University, Washington, D.C. Hurst Hall 203 rsg@american.edu (202) 885-3862 Introduction to STATA WORKSHOP OBJECTIVE: This workshop

More information

Stata v 12 Illustration. First Session

Stata v 12 Illustration. First Session Launch Stata PC Users Stata v 12 Illustration Mac Users START > ALL PROGRAMS > Stata; or Double click on the Stata icon on your desktop APPLICATIONS > STATA folder > Stata; or Double click on the Stata

More information

ECONOMICS 452* -- Stata 12 Tutorial 1. Stata 12 Tutorial 1. TOPIC: Getting Started with Stata: An Introduction or Review

ECONOMICS 452* -- Stata 12 Tutorial 1. Stata 12 Tutorial 1. TOPIC: Getting Started with Stata: An Introduction or Review Stata 12 Tutorial 1 TOPIC: Getting Started with Stata: An Introduction or Review DATA: auto1.raw and auto1.txt (two text-format data files) TASKS: Stata 12 Tutorial 1 is intended to introduce you to some

More information

ECONOMICS 351* -- Stata 10 Tutorial 1. Stata 10 Tutorial 1

ECONOMICS 351* -- Stata 10 Tutorial 1. Stata 10 Tutorial 1 TOPIC: Getting Started with Stata Stata 10 Tutorial 1 DATA: auto1.raw and auto1.txt (two text-format data files) TASKS: Stata 10 Tutorial 1 is intended to introduce (or re-introduce) you to some of the

More information

PubHlth 640 Intermediate Biostatistics Unit 2 - Regression and Correlation. Simple Linear Regression Software: Stata v 10.1

PubHlth 640 Intermediate Biostatistics Unit 2 - Regression and Correlation. Simple Linear Regression Software: Stata v 10.1 PubHlth 640 Intermediate Biostatistics Unit 2 - Regression and Correlation Simple Linear Regression Software: Stata v 10.1 Emergency Calls to the New York Auto Club Source: Chatterjee, S; Handcock MS and

More information

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

I Launching and Exiting Stata. Stata will ask you if you would like to check for updates. Update now or later, your choice. I Launching and Exiting Stata 1. Launching Stata Stata can be launched in either of two ways: 1) in the stata program, click on the stata application; or 2) double click on the short cut that you have

More information

Data Management 2. 1 Introduction. 2 Do-files. 2.1 Ado-files and Do-files

Data Management 2. 1 Introduction. 2 Do-files. 2.1 Ado-files and Do-files University of California, Santa Cruz Department of Economics ECON 294A (Fall 2014)- Stata Lab Instructor: Manuel Barron 1 Data Management 2 1 Introduction Today we are going to introduce the use of do-files,

More information

An Introduction to Stata Exercise 1

An Introduction to Stata Exercise 1 An Introduction to Stata Exercise 1 Anna Folke Larsen, September 2016 1 Table of Contents 1 Introduction... 1 2 Initial options... 3 3 Reading a data set from a spreadsheet... 5 4 Descriptive statistics...

More information

Chapter 2 The SAS Environment

Chapter 2 The SAS Environment Chapter 2 The SAS Environment Abstract In this chapter, we begin to become familiar with the basic SAS working environment. We introduce the basic 3-screen layout, how to navigate the SAS Explorer window,

More information

Stata: A Brief Introduction Biostatistics

Stata: A Brief Introduction Biostatistics Stata: A Brief Introduction Biostatistics 140.621 2005-2006 1. Statistical Packages There are many statistical packages (Stata, SPSS, SAS, Splus, etc.) Statistical packages can be used for Analysis Data

More information

Lab 2: OLS regression

Lab 2: OLS regression Lab 2: OLS regression Andreas Beger February 2, 2009 1 Overview This lab covers basic OLS regression in Stata, including: multivariate OLS regression reporting coefficients with different confidence intervals

More information

An Introduction to STATA ECON 330 Econometrics Prof. Lemke

An Introduction to STATA ECON 330 Econometrics Prof. Lemke An Introduction to STATA ECON 330 Econometrics Prof. Lemke 1. GETTING STARTED A requirement of this class is that you become very comfortable with STATA, a leading statistical software package. You were

More information

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

BIOSTATISTICS LABORATORY PART 1: INTRODUCTION TO DATA ANALYIS WITH STATA: EXPLORING AND SUMMARIZING DATA BIOSTATISTICS LABORATORY PART 1: INTRODUCTION TO DATA ANALYIS WITH STATA: EXPLORING AND SUMMARIZING DATA Learning objectives: Getting data ready for analysis: 1) Learn several methods of exploring the

More information

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

Introduction to Stata First Session. I- Launching and Exiting Stata Launching Stata Exiting Stata.. Introduction to Stata 2016-17 01. First Session I- Launching and Exiting Stata... 1. Launching Stata... 2. Exiting Stata.. II - Toolbar, Menu bar and Windows.. 1. Toolbar Key.. 2. Menu bar Key..... 3.

More information

An Introductory Guide to Stata

An Introductory Guide to Stata An Introductory Guide to Stata Scott L. Minkoff Assistant Professor Department of Political Science Barnard College sminkoff@barnard.edu Updated: July 9, 2012 1 TABLE OF CONTENTS ABOUT THIS GUIDE... 4

More information

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

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 Jennie Murack 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 How to conduct basic descriptive statistics

More information

Introduction to Stata - Session 1

Introduction to Stata - Session 1 Introduction to Stata - Session 1 Simon, Hong based on Andrea Papini ECON 3150/4150, UiO January 15, 2018 1 / 33 Preparation Before we start Sit in teams of two Download the file auto.dta from the course

More information

Advanced Regression Analysis Autumn Stata 6.0 For Dummies

Advanced Regression Analysis Autumn Stata 6.0 For Dummies Advanced Regression Analysis Autumn 2000 Stata 6.0 For Dummies Stata 6.0 is the statistical software package we ll be using for much of this course. Stata has a number of advantages over other currently

More information

Depending on the computer you find yourself in front of, here s what you ll need to do to open SPSS.

Depending on the computer you find yourself in front of, here s what you ll need to do to open SPSS. 1 SPSS 11.5 for Windows Introductory Assignment Material covered: Opening an existing SPSS data file, creating new data files, generating frequency distributions and descriptive statistics, obtaining printouts

More information

To complete the computer assignments, you ll use the EViews software installed on the lab PCs in WMC 2502 and WMC 2506.

To complete the computer assignments, you ll use the EViews software installed on the lab PCs in WMC 2502 and WMC 2506. An Introduction to EViews The purpose of the computer assignments in BUEC 333 is to give you some experience using econometric software to analyse real-world data. Along the way, you ll become acquainted

More information

Introduction to Stata - Session 2

Introduction to Stata - Session 2 Introduction to Stata - Session 2 Siv-Elisabeth Skjelbred ECON 3150/4150, UiO January 26, 2016 1 / 29 Before we start Download auto.dta, auto.csv from course home page and save to your stata course folder.

More information

Getting Started Using Stata

Getting Started Using Stata Categorical Data Analysis Getting Started Using Stata Scott Long and Shawna Rohrman cda12 StataGettingStarted 2012 05 11.docx Getting Started in Stata Opening Stata When you open Stata, the screen has

More information

Intro to Stata for Political Scientists

Intro to Stata for Political Scientists Intro to Stata for Political Scientists Andrew S. Rosenberg Junior PRISM Fellow Department of Political Science Workshop Description This is an Introduction to Stata I will assume little/no prior knowledge

More information

Week 4: Simple Linear Regression II

Week 4: Simple Linear Regression II Week 4: Simple Linear Regression II Marcelo Coca Perraillon University of Colorado Anschutz Medical Campus Health Services Research Methods I HSMP 7607 2017 c 2017 PERRAILLON ARR 1 Outline Algebraic properties

More information

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

Survey of Math: Excel Spreadsheet Guide (for Excel 2016) Page 1 of 9 Survey of Math: Excel Spreadsheet Guide (for Excel 2016) Page 1 of 9 Contents 1 Introduction to Using Excel Spreadsheets 2 1.1 A Serious Note About Data Security.................................... 2 1.2

More information

Week 4: Simple Linear Regression III

Week 4: Simple Linear Regression III Week 4: Simple Linear Regression III Marcelo Coca Perraillon University of Colorado Anschutz Medical Campus Health Services Research Methods I HSMP 7607 2017 c 2017 PERRAILLON ARR 1 Outline Goodness of

More information

An Introduction to Stata Part I: Data Management

An Introduction to Stata Part I: Data Management An Introduction to Stata Part I: Data Management Kerry L. Papps 1. Overview These two classes aim to give you the necessary skills to get started using Stata for empirical research. The first class will

More information

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

Stata version 13. First Session. January I- Launching and Exiting Stata Launching Stata Exiting Stata.. Stata version 13 January 2015 I- Launching and Exiting Stata... 1. Launching Stata... 2. Exiting Stata.. II - Toolbar, Menu bar and Windows.. 1. Toolbar Key.. 2. Menu bar Key..... 3. Windows..... III -...

More information

A quick introduction to STATA:

A quick introduction to STATA: 1 Revised September 2008 A quick introduction to STATA: (by E. Bernhardsen, with additions by H. Goldstein) 1. How to access STATA from the pc s at the computer lab After having logged in you have to log

More information

1 Introduction to Using Excel Spreadsheets

1 Introduction to Using Excel Spreadsheets Survey of Math: Excel Spreadsheet Guide (for Excel 2007) Page 1 of 6 1 Introduction to Using Excel Spreadsheets This section of the guide is based on the file (a faux grade sheet created for messing with)

More information

Applied Regression Modeling: A Business Approach

Applied Regression Modeling: A Business Approach i Applied Regression Modeling: A Business Approach Computer software help: SAS SAS (originally Statistical Analysis Software ) is a commercial statistical software package based on a powerful programming

More information

2 The Stata user interface

2 The Stata user interface 2 The Stata user interface The windows This chapter introduces the core of Stata s interface: its main windows, its toolbar, its menus, and its dialogs. The five main windows are the Review, Results, Command,

More information

SPSS 11.5 for Windows Assignment 2

SPSS 11.5 for Windows Assignment 2 1 SPSS 11.5 for Windows Assignment 2 Material covered: Generating frequency distributions and descriptive statistics, converting raw scores to standard scores, creating variables using the Compute option,

More information

Introduction to STATA

Introduction to STATA Introduction to STATA Duah Dwomoh, MPhil School of Public Health, University of Ghana, Accra July 2016 International Workshop on Impact Evaluation of Population, Health and Nutrition Programs Learning

More information

An Introduction to Stata

An Introduction to Stata An Introduction to Stata Instructions Statistics 111 - Probability and Statistical Inference Jul 3, 2013 Lab Objective To become familiar with the software package Stata. Lab Procedures Stata gives us

More information

FrontPage 98 Quick Guide. Copyright 2000 Peter Pappas. edteck press All rights reserved.

FrontPage 98 Quick Guide. Copyright 2000 Peter Pappas. edteck press All rights reserved. Master web design skills with Microsoft FrontPage 98. This step-by-step guide uses over 40 full color close-up screen shots to clearly explain the fast and easy way to design a web site. Use edteck s QuickGuide

More information

Empirical Asset Pricing

Empirical Asset Pricing Department of Mathematics and Statistics, University of Vaasa, Finland Texas A&M University, May June, 2013 As of May 17, 2013 Part I Stata Introduction 1 Stata Introduction Interface Commands Command

More information

Introduction to STATA 6.0 ECONOMICS 626

Introduction to STATA 6.0 ECONOMICS 626 Introduction to STATA 6.0 ECONOMICS 626 Bill Evans Fall 2001 This handout gives a very brief introduction to STATA 6.0 on the Economics Department Network. In a few short years, STATA has become one of

More information

ST Lab 1 - The basics of SAS

ST Lab 1 - The basics of SAS ST 512 - Lab 1 - The basics of SAS What is SAS? SAS is a programming language based in C. For the most part SAS works in procedures called proc s. For instance, to do a correlation analysis there is proc

More information

Easy Windows Working with Disks, Folders, - and Files

Easy Windows Working with Disks, Folders, - and Files Easy Windows 98-3 - Working with Disks, Folders, - and Files Page 1 of 11 Easy Windows 98-3 - Working with Disks, Folders, - and Files Task 1: Opening Folders Folders contain files, programs, or other

More information

Review of Stata II AERC Training Workshop Nairobi, May 2002

Review of Stata II AERC Training Workshop Nairobi, May 2002 Review of Stata II AERC Training Workshop Nairobi, 20-24 May 2002 This note provides more information on the basics of Stata that should help you with the exercises in the remaining sessions of the workshop.

More information

TUTORIAL FOR IMPORTING OTTAWA FIRE HYDRANT PARKING VIOLATION DATA INTO MYSQL

TUTORIAL FOR IMPORTING OTTAWA FIRE HYDRANT PARKING VIOLATION DATA INTO MYSQL TUTORIAL FOR IMPORTING OTTAWA FIRE HYDRANT PARKING VIOLATION DATA INTO MYSQL We have spent the first part of the course learning Excel: importing files, cleaning, sorting, filtering, pivot tables and exporting

More information

Getting Started Using Stata

Getting Started Using Stata Quant II 2011: Categorical Data Analysis Getting Started Using Stata Shawna Rohrman 2010 05 09 Revised by Trisha Tiamzon 2010 12 26 Note: Parts of this guide were adapted from Stata s Getting Started with

More information

A quick introduction to STATA

A quick introduction to STATA A quick introduction to STATA Data files and other resources for the course book Introduction to Econometrics by Stock and Watson is available on: http://wps.aw.com/aw_stock_ie_3/178/45691/11696965.cw/index.html

More information

Intermediate Stata. Jeremy Craig Green. 1 March /29/2011 1

Intermediate Stata. Jeremy Craig Green. 1 March /29/2011 1 Intermediate Stata Jeremy Craig Green 1 March 2011 3/29/2011 1 Advantages of Stata Ubiquitous in economics and political science Gaining popularity in health sciences Large library of add-on modules Version

More information

Revision of Stata basics in STATA 11:

Revision of Stata basics in STATA 11: Revision of Stata basics in STATA 11: April, 2016 Dr. Selim Raihan Executive Director, SANEM Professor, Department of Economics, University of Dhaka Contents a) Resources b) Stata 11 Interface c) Datasets

More information

GRETL FOR TODDLERS!! CONTENTS. 1. Access to the econometric software A new data set: An existent data set: 3

GRETL FOR TODDLERS!! CONTENTS. 1. Access to the econometric software A new data set: An existent data set: 3 GRETL FOR TODDLERS!! JAVIER FERNÁNDEZ-MACHO CONTENTS 1. Access to the econometric software 3 2. Loading and saving data: the File menu 3 2.1. A new data set: 3 2.2. An existent data set: 3 2.3. Importing

More information

Week 1: Introduction to Stata

Week 1: Introduction to Stata Week 1: Introduction to Stata Marcelo Coca Perraillon University of Colorado Anschutz Medical Campus Health Services Research Methods I HSMP 7607 2017 c 2017 PERRAILLON ALL RIGHTS RESERVED 1 Outline Log

More information

Week 5: Multiple Linear Regression II

Week 5: Multiple Linear Regression II Week 5: Multiple Linear Regression II Marcelo Coca Perraillon University of Colorado Anschutz Medical Campus Health Services Research Methods I HSMP 7607 2017 c 2017 PERRAILLON ARR 1 Outline Adjusted R

More information

A quick introduction to STATA:

A quick introduction to STATA: 1 HG Revised September 2011 A quick introduction to STATA: (by E. Bernhardsen, with additions by H. Goldstein) 1. How to access STATA from the pc s at the computer lab and elsewhere at UiO. At the computer

More information

. predict mod1. graph mod1 ed, connect(l) xlabel ylabel l1(model1 predicted income) b1(years of education)

. predict mod1. graph mod1 ed, connect(l) xlabel ylabel l1(model1 predicted income) b1(years of education) DUMMY VARIABLES AND INTERACTIONS Let's start with an example in which we are interested in discrimination in income. We have a dataset that includes information for about 16 people on their income, their

More information

Introduction to SAS. I. Understanding the basics In this section, we introduce a few basic but very helpful commands.

Introduction to SAS. I. Understanding the basics In this section, we introduce a few basic but very helpful commands. Center for Teaching, Research and Learning Research Support Group American University, Washington, D.C. Hurst Hall 203 rsg@american.edu (202) 885-3862 Introduction to SAS Workshop Objective This workshop

More information

STATA Tutorial. Introduction to Econometrics. by James H. Stock and Mark W. Watson. to Accompany

STATA Tutorial. Introduction to Econometrics. by James H. Stock and Mark W. Watson. to Accompany STATA Tutorial to Accompany Introduction to Econometrics by James H. Stock and Mark W. Watson STATA Tutorial to accompany Stock/Watson Introduction to Econometrics Copyright 2003 Pearson Education Inc.

More information

Chapter One: Getting Started With IBM SPSS for Windows

Chapter One: Getting Started With IBM SPSS for Windows Chapter One: Getting Started With IBM SPSS for Windows Using Windows The Windows start-up screen should look something like Figure 1-1. Several standard desktop icons will always appear on start up. Note

More information

Creating a data file and entering data

Creating a data file and entering data 4 Creating a data file and entering data There are a number of stages in the process of setting up a data file and analysing the data. The flow chart shown on the next page outlines the main steps that

More information

Introduction to Stata. Getting Started. This is the simple command syntax in Stata and more conditions can be added as shown in the examples.

Introduction to Stata. Getting Started. This is the simple command syntax in Stata and more conditions can be added as shown in the examples. Getting Started Command Syntax command varlist, option This is the simple command syntax in Stata and more conditions can be added as shown in the examples. Preamble mkdir tutorial /* to create a new directory,

More information

range: [1,20] units: 1 unique values: 20 missing.: 0/20 percentiles: 10% 25% 50% 75% 90%

range: [1,20] units: 1 unique values: 20 missing.: 0/20 percentiles: 10% 25% 50% 75% 90% ------------------ log: \Term 2\Lecture_2s\regression1a.log log type: text opened on: 22 Feb 2008, 03:29:09. cmdlog using " \Term 2\Lecture_2s\regression1a.do" (cmdlog \Term 2\Lecture_2s\regression1a.do

More information

STATA TUTORIAL B. Rabin with modifications by T. Marsh

STATA TUTORIAL B. Rabin with modifications by T. Marsh STATA TUTORIAL B. Rabin with modifications by T. Marsh 5.2.05 (content also from http://www.ats.ucla.edu/stat/spss/faq/compare_packages.htm) Why choose Stata? Stata has a wide array of pre-defined statistical

More information

Excel 2013 Beyond TheBasics

Excel 2013 Beyond TheBasics Excel 2013 Beyond TheBasics INSTRUCTOR: IGNACIO DURAN Excel 2013 Beyond The Basics This is a class for beginning computer users. You are only expected to know how to use the mouse and keyboard, open a

More information

TUTORIAL FOR IMPORTING OTTAWA FIRE HYDRANT PARKING VIOLATION DATA INTO MYSQL

TUTORIAL FOR IMPORTING OTTAWA FIRE HYDRANT PARKING VIOLATION DATA INTO MYSQL TUTORIAL FOR IMPORTING OTTAWA FIRE HYDRANT PARKING VIOLATION DATA INTO MYSQL We have spent the first part of the course learning Excel: importing files, cleaning, sorting, filtering, pivot tables and exporting

More information

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

After opening Stata for the first time: set scheme s1mono, permanently 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

More information

Using Microsoft Excel

Using Microsoft Excel Using Microsoft Excel Introduction This handout briefly outlines most of the basic uses and functions of Excel that we will be using in this course. Although Excel may be used for performing statistical

More information

Principles of Biostatistics and Data Analysis PHP 2510 Lab2

Principles of Biostatistics and Data Analysis PHP 2510 Lab2 Goals for Lab2: Familiarization with Do-file Editor (two important features: reproducible and analysis) Reviewing commands for summary statistics Visual depiction of data- bar chart and histograms Stata

More information

Stata Session 2. Tarjei Havnes. University of Oslo. Statistics Norway. ECON 4136, UiO, 2012

Stata Session 2. Tarjei Havnes. University of Oslo. Statistics Norway. ECON 4136, UiO, 2012 Stata Session 2 Tarjei Havnes 1 ESOP and Department of Economics University of Oslo 2 Research department Statistics Norway ECON 4136, UiO, 2012 Tarjei Havnes (University of Oslo) Stata Session 2 ECON

More information

This is a separate window in the software so if you wish to return to the main screen, just close this window by clicking X in the upper right corner.

This is a separate window in the software so if you wish to return to the main screen, just close this window by clicking X in the upper right corner. Following is a basic overview of the Wishon Golf Shaft Bend Profile software program. The program contains an ever increasing data base of the full length stiffness measurements with weight and balance

More information

Customizing DAZ Studio

Customizing DAZ Studio Customizing DAZ Studio This tutorial covers from the beginning customization options such as setting tabs to the more advanced options such as setting hot keys and altering the menu layout. Introduction:

More information

Introduction to Stata

Introduction to Stata Introduction to Stata Introduction In introductory biostatistics courses, you will use the Stata software to apply statistical concepts and practice analyses. Most of the commands you will need are available

More information

Course contents. Overview: Goodbye, calculator. Lesson 1: Get started. Lesson 2: Use cell references. Lesson 3: Simplify formulas by using functions

Course contents. Overview: Goodbye, calculator. Lesson 1: Get started. Lesson 2: Use cell references. Lesson 3: Simplify formulas by using functions Course contents Overview: Goodbye, calculator Lesson 1: Get started Lesson 2: Use cell references Lesson 3: Simplify formulas by using functions Overview: Goodbye, calculator Excel is great for working

More information

tabulate varname [aw=weightvar]

tabulate varname [aw=weightvar] 1 Commands Introduced In this chapter you will learn these Stata basics: How to obtain information about a dataset How to obtain information about variables How to write and save a Do-file (a file that

More information

25 Working with categorical data and factor variables

25 Working with categorical data and factor variables 25 Working with categorical data and factor variables Contents 25.1 Continuous, categorical, and indicator variables 25.1.1 Converting continuous variables to indicator variables 25.1.2 Converting continuous

More information

TYPES OF VARIABLES, STRUCTURE OF DATASETS, AND BASIC STATA LAYOUT

TYPES OF VARIABLES, STRUCTURE OF DATASETS, AND BASIC STATA LAYOUT PRIMER FOR ACS OUTCOMES RESEARCH COURSE: TYPES OF VARIABLES, STRUCTURE OF DATASETS, AND BASIC STATA LAYOUT STEP 1: Install STATA statistical software. STEP 2: Read through this primer and complete the

More information

The QuickCalc BASIC User Interface

The QuickCalc BASIC User Interface The QuickCalc BASIC User Interface Running programs in the Windows Graphic User Interface (GUI) mode. The GUI mode is far superior to running in the CONSOLE mode. The most-used functions are on buttons,

More information

Exercise 1: Introduction to Stata

Exercise 1: Introduction to Stata Exercise 1: Introduction to Stata New Stata Commands use describe summarize stem graph box histogram log on, off exit New Stata Commands Downloading Data from the Web I recommend that you use Internet

More information

Panel Data 4: Fixed Effects vs Random Effects Models

Panel Data 4: Fixed Effects vs Random Effects Models Panel Data 4: Fixed Effects vs Random Effects Models Richard Williams, University of Notre Dame, http://www3.nd.edu/~rwilliam/ Last revised April 4, 2017 These notes borrow very heavily, sometimes verbatim,

More information

Computers for Beginners

Computers for Beginners Computers for Beginners Class Objective: This class will familiarize you with using computers. By the end of the session you will be familiar with: Starting programs Quitting programs Saving files Opening

More information

Lab 1: Introduction, Plotting, Data manipulation

Lab 1: Introduction, Plotting, Data manipulation Linear Statistical Models, R-tutorial Fall 2009 Lab 1: Introduction, Plotting, Data manipulation If you have never used Splus or R before, check out these texts and help pages; http://cran.r-project.org/doc/manuals/r-intro.html,

More information

For many people, learning any new computer software can be an anxietyproducing

For many people, learning any new computer software can be an anxietyproducing 1 Getting to Know Stata 12 For many people, learning any new computer software can be an anxietyproducing task. When that computer program involves statistics, the stress level generally increases exponentially.

More information

If you use Stata for Windows, starting Stata is straightforward. You just have to double-click on the wstata (or stata) icon.

If you use Stata for Windows, starting Stata is straightforward. You just have to double-click on the wstata (or stata) icon. Stata Handout 1. Starting Stata If you use Stata for Windows, starting Stata is straightforward. You just have to double-click on the wstata (or stata) icon. If you use Stata for Unix, type at the athena

More information

Chapter 11 Dealing With Data SPSS Tutorial

Chapter 11 Dealing With Data SPSS Tutorial Chapter 11 Dealing With Data SPSS Tutorial 1. Visit the student website at for this textbook at www.clowjames.net/students. 2. Download the following files: Chapter 11 Dealing with Data (SPSS data file)

More information

Using Microsoft Excel

Using Microsoft Excel Using Microsoft Excel Files in Microsoft Excel are referred to as Workbooks. This is because they can contain more than one sheet. The number of sheets a workbook can contain is only limited by your computer

More information

API-202 Empirical Methods II Spring 2004 A SHORT INTRODUCTION TO STATA 8.0

API-202 Empirical Methods II Spring 2004 A SHORT INTRODUCTION TO STATA 8.0 API-202 Empirical Methods II Spring 2004 A SHORT INTRODUCTION TO STATA 8.0 Course materials and data sets will assume that you are using Stata to complete the analysis. Stata is available on all of the

More information

Computer Basics. Hardware. This class is designed to cover the following basics:

Computer Basics. Hardware. This class is designed to cover the following basics: Computer Basics This class is designed to cover the following basics: computer hardware software computer s operating system different kinds of storage devices you can use to save files using a mouse what

More information

How to Archive s in Outlook 2007

How to Archive  s in Outlook 2007 How to Archive Emails in Outlook 2007 Step 1: Create an archive folder. 1. Go to File and choose Archive 2. You can have it auto-archive or set the parameters to where it creates an empty archive. Due

More information

Intermediate Excel 2003

Intermediate Excel 2003 Intermediate Excel 2003 Introduction The aim of this document is to introduce some techniques for manipulating data within Excel, including sorting, filtering and how to customise the charts you create.

More information

Lecture 3: The basic of programming- do file and macro

Lecture 3: The basic of programming- do file and macro Introduction to Stata- A. Chevalier Lecture 3: The basic of programming- do file and macro Content of Lecture 3: -Entering and executing programs do file program ado file -macros 1 A] Entering and executing

More information

STATA 13 INTRODUCTION

STATA 13 INTRODUCTION STATA 13 INTRODUCTION Catherine McGowan & Elaine Williamson LONDON SCHOOL OF HYGIENE & TROPICAL MEDICINE DECEMBER 2013 0 CONTENTS INTRODUCTION... 1 Versions of STATA... 1 OPENING STATA... 1 THE STATA

More information

SAS Training Spring 2006

SAS Training Spring 2006 SAS Training Spring 2006 Coxe/Maner/Aiken Introduction to SAS: This is what SAS looks like when you first open it: There is a Log window on top; this will let you know what SAS is doing and if SAS encountered

More information

Stata versions 12 & 13 Week 4 Practice Problems

Stata versions 12 & 13 Week 4 Practice Problems Stata versions 12 & 13 Week 4 Practice Problems SOLUTIONS 1 Practice Screen Capture a Create a word document Name it using the convention lastname_lab1docx (eg bigelow_lab1docx) b Using your browser, go

More information

Stata For Dummies. Table of Contents

Stata For Dummies. Table of Contents Stata For Dummies Christopher Zorn University of South Carolina Oxford Spring School June 18-20, 2007 Table of Contents 1 Introduction 1 2 Things You Need To Know 2 3 Starting Stata 2 4 Entering Commands

More information

ECO375 Tutorial 1 Introduction to Stata

ECO375 Tutorial 1 Introduction to Stata ECO375 Tutorial 1 Introduction to Stata Matt Tudball University of Toronto Mississauga September 14, 2017 Matt Tudball (University of Toronto) ECO375H5 September 14, 2017 1 / 25 What Is Stata? Stata is

More information

Excel Basics Rice Digital Media Commons Guide Written for Microsoft Excel 2010 Windows Edition by Eric Miller

Excel Basics Rice Digital Media Commons Guide Written for Microsoft Excel 2010 Windows Edition by Eric Miller Excel Basics Rice Digital Media Commons Guide Written for Microsoft Excel 2010 Windows Edition by Eric Miller Table of Contents Introduction!... 1 Part 1: Entering Data!... 2 1.a: Typing!... 2 1.b: Editing

More information

What is Stata? A programming language to do sta;s;cs Strongly influenced by economists Open source, sort of. An acceptable way to manage data

What is Stata? A programming language to do sta;s;cs Strongly influenced by economists Open source, sort of. An acceptable way to manage data Introduc)on to Stata Training Workshop on the Commitment to Equity Methodology CEQ Ins;tute, Asian Development Bank, and The Ministry of Finance Dili May-June, 2017 What is Stata? A programming language

More information

QUICKBOOKS TO ACCOUNTEDGE CONVERSION GUIDE

QUICKBOOKS TO ACCOUNTEDGE CONVERSION GUIDE QUICKBOOKS TO ACCOUNTEDGE CONVERSION GUIDE Our goal is to save you as much time as possible while you transition your business accounting software. While accounting is accounting, AccountEdge takes a very

More information