Introduction to Stata
Hyosung Kwon
1
Introduction: STATA
n
n
STATA is a statistical package that can be used
to analyze and manipulate data, econometric
analysis, and programming.
All the information regarding STATA can be
found at <www.stata.com>.
Other
Lecture 1
Using directories to organize your work
You can find out what directory you're in by typing
. pwd
F:\StataStuff
To find where the "official Stata directory" is, type:
. sysdir
STATA:
UPDATES:
C:\Stata8\
C:\Stata8\ado\updates\
BASE:
C:\Stata8\a
CAS EC507 A1: Statistics for Economists
Fall 2014
Lectures: Monday and Wednesday, 5:30-7:00pm, B36
TA session: Friday, 2:00-3:30pm, B36
Instructor: Maria Tripolski Kimel
Email: mtkimel@bu.edu (the best way to contact me)
Office: Room 437, 270 Bay State Rd
EC507 A1: Statistics for Economists
Fall 2015
Problem Set 6
Due Friday, October 30
Late problem sets will not be accepted no exceptions. You may work together on the problem set, but
every student has to hand in his/her own answers. All questions count f
1
STATISTICS FOR
ECONOMISTS
EC 507 A1
2
Introduction
Statistics is an art of learning from data.
The field of statistics is concerned with the scientific study of collecting,
organizing, analyzing, and drawing conclusions from data. It also involves
mod
1
COUNTING
TECHNIQUES IN
PROBABILITY
Statistics for Economists EC 507 A1
2
Calculating Probability of an Event
Axiomatic definition of probability states only the conditions an assignment of
probabilities must satisfy, but it does not tell us how to assi
1
CONDITIONAL
PROBABILITY
Statistics for Economists EC 507 A1
2
Conditional Probability
Example 1
Assume in a population, there is an equal number of men and women.
All men smoke, all women do not smoke.
If a person is chosen, what is the probability t
1
INTRODUCTION TO
PROBABILITY
Statistics for Economists EC 507 A1
2
Introduction
After the data is described and summarized, we hope to be able to
draw a conclusion on a question of interest.
The part of statistics concerned with the drawing of conclusi
1
DISTRIBUTION OF
SAMPLING STATISTICS
Statistics for Economists EC 507 A1
2
Random Sample
Example
Assume we want to study the distribution of household income in Boston.
Our population is all the households leaving in Boston, but we cant observe
the inc
1
MULTIVARIATE
PROBABILITY
DISTRIBUTIONS
Statistics for Economists EC 507 A1
2
Introduction
For a given experiment, we are often interested in relationships of two or more random
variables.
For a study of lung cancer, a researcher is interested in the n
1
MULTIVARIATE PROBABILITY
DISTRIBUTIONS PART II
Statistics for Economists EC 507 A1
2
Expected Value of a Bivariate Random Variable
Discrete Case
Definition:
Let
and
function
Let
,
,
be two discrete random variables with the joint probability
, .
be a
1
RANDOM VARIABLES
AND PROBABILITY
DISTRIBUTIONS
Statistics for Economists EC 507 A1
2
Random Variables
Definition:
A random variable
With each outcome
is a real-valued function defined on a sample space .
,
, it associates a real number:
,
,
3
Exampl
1
SPECIAL CONTINUOUS
DISTRIBUTIONS
Statistics for Economists EC 507 A1
2
Special Continuous Distributions
Uniform distribution on an interval
Normal distribution
Exponential distribution
Gamma distribution
Chi-square distribution
3
Uniform Distributi
CAS EC507 A1: Statistics for Economists
Fall 2015
Lectures: Monday and Wednesday, 5:30-7:00pm, EPC 209
TA session: Friday, 2:00-3:00pm, EPC 209
Instructor: Maria Tripolski Kimel
Email: mtkimel@bu.edu
Office: Room 437, 270 Bay State Rd.
Office hours: Mond
EC507 A: Statistics for Economists
Fall 2014
PS5 Solution
1. (a) The total number of ways to draw four marbles from the urn without replacement is
!
!" , which is 24232221. And the number of possible ways to draw X blue
marbles and Y red marbles is
! !
1
INTRODUCTION TO
PROBABILITY
Statistics for Economists EC 507 A1
2
Introduction
After the data is described and summarized, we hope to be able to
draw a conclusion on a question of interest.
The part of statistics concerned with the drawing of conclusi
1
STATISTICS FOR
ECONOMISTS
EC 507 A1
2
Introduction
Statistics is art of learning from data.
Most scientic or industrial studies and experiments produce data,
and the analysis of these data and drawing useful conclusions from
them become one of the cen
clear
/* this clears the memory so that a new dataset can be loaded */
/ Setting log-file configuration
capture log close
/* closes a log file if one is open without causing an error if there is not a log file open */
set logtype text /Or you can replace
EC507 A1: Statistics for Economists
Fall 2014
Introduction to Stata
This useful handout provides an introduction to Stata for Windows and is borrowed from the
same class taught in 2010 by Prof. Ivan Fernandez-Val. More information on how to use Stata
coul
Introductory Instructional Videos
In order to get the most out of these videos I suggest that you have Stata open while you watch each video and
that you periodically pause the video and do what you just viewed using your copy of Stata (the videos mostly
EC507 A1: Statistics for Economists
Fall 2015
Problem Set 5
Due Friday, October 16
Late problem sets will not be accepted no exceptions. You may work together on the problem set, but
every student has to hand in his/her own answers. All questions count f
EC507 PS2 Solution
1 a)False.
A B \C
A B\C
A contradicting example:
Let A=cfw_1, B=cfw_1 and C=cfw_1, then A B = cfw_1 and A B \C = .
However, B\C = and A B\C = cfw_1.
1
b) False.
A B C:
A B C B :
A contradicting example:
Let A=cfw_1,2, B=cfw_1,
EC507 PS4 Solution
1. (a) We have 5 men and 5 women who are ranked according to their scores on an exam, where no
two scores are alike and all 10! possible rankings are equally likely. Let X denote the highest
ranking achieved by a woman. Clearly, since 6
1
SPECIAL DISCRETE
DISTRIBUTIONS
Statistics for Economists EC 507 A1
2
Special Discrete Distributions
Binomial Distribution
Poisson Distribution
Uniform Distribution on Integers covered previously
3
Binomial Distribution
Bernoulli Random Variable
Bern