This document is partially blurred.
Unlock all pages and 1 million more documents.
Get Access
INTRODUCTION TO USING STATA FOR
ECONOMETRICS
November 14-18, 2016
Dushanbe, Tajikistan
Allen Park and Jarilkasin Ilyasov
Purpose of the Course
•The purpose of the course is to provide an introduction to Stata
•It is very difficult to develop Stata skill from a course alone
•You are expected to continue to develop your Stata ability by yourself
with additional resources after the course
•This course does not presume deep background in computer and
statistical software
–Knowing Excel or SPSS will help, but is not necessary
•Stata syntax (the “grammar” of Stata language) can be difficult, and you
are not expected to memorize all the commands
–However, you need to know where to look and to understand what errors you
are making in order to avoid mistakes in the future
•Schedule of the course
Introduction to Stata
•What is Stata?
–A computer program that can be used for data analysis, data management, and graphics
–It has a wide application and can be used for household surveys, macroeconomic data, “big
data” (data derived from mass data-collecting activities), etc.
•What applications do you foresee using Stata in your own work?
•Why use Stata?
–Over Excel
•Excel is easier to use and good for quick graphing, but not as robust in terms of statistical analysis; also in
Excel many things have to be done manually (hard to apply broad rules) Stata also allows you to keep track
of your work
–Over SPSS
•While Stata’s capabilities are seen more at the advanced end, it is easier to get support for Stata, and more
widely used in academia
–Over R
•While R is free and accessible to the public, Stata is easier to learn and again, the community of users is
wider…for now
Basic interface
•Default display at program start
Basic interface
•Type sysuse auto
–Stata comes with example datasets that are used for examples
–Type sysuse dir to see other example datasets
Basic Interface Summary
•Main Window
–Shows the result of your actions
•Command Line
–Where you type in your actions
•Variables
–Lists variables associated with the dataset
•Review Window
–Tracks the commands you enter
•Directory bar
Browser Window
•Browser
–Offers traditional view of datasets
Data browser
•Browser window
Exercises
Browser Window
- How many cars are listed there?
- What is the most expensive car that is listed?
- How many variables are listed?
Variables Tab in the Browser Window
-Can you read the label for “foreign?”
- Can you hide everything except for make and price?
From the main command window
- How can you call up the browser window?
-browse
Basic File Management
•dir – “directory,” shows all the files that are in the folder
–Can you find which folder it is currently in?
•pwd – “present working directory”
•Create a folder on Windows where you want all these training
files to be placed
•cd – “change directory,” changes the folder where you are
working from
Basic syntax and mathematical operators
•disp = display
–What happens when you type disp “Hello”
–What happens when you type disp “Hello” “world”
–What happens when you type disp hello?
–Use “ ” when you are describing string characters (text)
•Otherwise, Stata will think you are talking about variables
•Mathematical operators include: + - * / ^ ( )
–What happens when you display 4
–What happens when you display 4 + 7
–How would you display (21-12)*3
–How would you display (36+12)−42
(4 ∗ 2)
Basic data commands
•describe - describes aspects of the data
–How would you describe only one variable, like “weight?”
•list - lists all the data
How would you list one variable like “make?”
–How would you list two variables like “make” and “price?”
–Remember the distinction between list and list for variables
3milk 4
Trusted by Thousands of
Students
Here are what students say about us.
Resources
Company
Copyright ©2022 All rights reserved. | CoursePaper is not sponsored or endorsed by any college or university.