*If you copy and paste these notes into a Do-File, you can practice on your
own.
*Mean and Median
use http:/amu-chemlab.avemaria.edu/~martinez/ECON230/mpg, clear
describe
hist mpg
* How is this histogram drawn? How many bins? Where does it start?
How wide
*More exercises
use http:/amu-chemlab.avemaria.edu/~martinez/ECON230/amount_spent.dta
describe
br
tabstat amountspent, stat(mean)
hist a
tabstat amountspent, stat(mean median)
tabstat am if am<50, stat(mean median)
hist am if am<50
use http:/amu-chemlab.a
clear
set obs 1000 /*Create one thousand spaces for data*/
set seed 1
/*Start at a particular point in the random number list. This
way we can repeat the random draw and always get the same number*/
gen x = int(uniform()*100)
/*Generate 100 random numbers
Study Guide Quiz 1
Definitions
Chapter 1
Method of comparison
Treatment group
Randomized controlled
experiment
Chapter 2
Observational study
Confounder
Treatment
Control group
Placebo
Response
Confounding
Double-blind experiment
Association
Causation
Cont
*If you copy and paste these notes into a Do-File, you can practice on your
own.
sysuse auto.dta
describe
label variable length "Length (inches)"
scatter mpg rep78
notes
notes length: Change label on TS
summarize
codebook
histogram headroom
hist gear_rati
*Ch 5 The Normal Approximation to Data
* The Normal Distribution
sysuse census, clear
*what does the following command do?
gen divorcert = divorce/pop*1000
sum divorcert
*is this variable Normally distributed?
hist divorcert
*Does the picture of Normality
Notes Chapter 3 Freedman, Pisani, and Purves
Exercises
Bar Charts and Pie Charts
In PowerPoint,
o insert a table and content slide. Click on the chart icon. Select Bar
(or Pie) Chart
o Paste (or input) the data in the table. Resize the chart data range t
sysuse auto
/*Changing the scale of the data doesn't change the correlation*/
scatter mpg headroom, name(imperial, replace)
corr mpg headroom
/*1 mile per gallon = 0.425143707 kilometers per liter*/
gen kpl = mpg * 0.425143707
/*1 inch = 2.54 centimeters
*Read chapters 1, 2, 5, 6, 13, 14, 15 in "Getting Started with Stata".
*Most of these are REALLY SHORT chapters
*Then copy all of the text in this webpage on a Do-file (see chapter 13)
*Open the Census example dataset in Stata by going File | Example
Data
Notes Chapter 3 Freedman, Pisani, and Purves
Exercises
Histogram
Summarizing data
o In blocks
Horizontal scale
o Each block represents a range of values
o The width of each block is the same
No vertical scale (?)
o Height is how many observations lie w
Notes for Chapter 11, FPP
use http:/amu-chemlab.avemaria.edu/~martinez/ECON230/testgrades.dta
Copy the variable test1 into an Excel sheet. Do the same for final. Close
Stata.
Calculate the slope of the regression line. Because final is the dependent
varia
*Ch 5 The Normal Approximation to Data
*In Stata, the command normal( ) returns the cumulative probability
associated with the standard normal variable.
*For example if we would like to find the area under
*the standard normal distributions probability de
Statistical Inference
A short summary
Get a sample
o Other peoples samples (out of the same population) may be different
Calculate descriptive statistics (such as the sample mean).
o Law of large numbers (Law of Averages)
The larger a sample gets, the clo
* * One-sample tests *
* 1. A team of researchers is interested in the ecological health of the
Ozark Highland ecoregion in Arkansas. To measure ecological health, they are
using the Index of Biological Integrity. They have collected data for the
IBI from
ssc install hangroot
clear
set obs 1000
gen ten = rbinomial(10,0.5)
/*Suppose you tossed a coin 10 times, and counted the heads.*/
gen thirty = rbinomial(30,0.5)
gen threehundred = rbinomial(300,0.5)
gen thirtythousand = rbinomial(30000,0.5)
br
hangroot t