Chapter1
Neville Andrade
3 August 2016
Chapter 1 - Page 27
#### U.S. Egg production
egg_prod <- read.table(file = "https://raw.githubusercontent.com/cablegui/Econometrics/master/OriginalData/Table%201.1.txt",
skip = 7, header = TRUE)
colnames(egg_prod)
## [1] "STATE" "Y1" "Y2" "X1" "X2"
head(egg_prod)
## STATE Y1 Y2 X1 X2
## 1 AL 2206.0 2186.0 92.7 91.4
## 2 AK 0.7 0.7 151.0 149.0
## 3 AZ 73.0 74.0 61.0 56.0
## 4 AR 3620.0 3737.0 86.3 91.8
## 5 CA 7472.0 7444.0 63.4 58.4
## 6 CO 788.0 873.0 77.8 73.0
Desription of data set
======================
Data set shows U.S. egg production and egg prices for 50 U.S. states for 1990 and 1991. This is an example of cross-sectional data. Cross-sectional data is data collected on one or more variables at the same point in time. This data set has two cross-sectional data, for 1990 and 1991. The variables are the amount of eggs (in millions) and the price per dozen (in cents).
STATE – The short code for the state within the U.S. union
Y1 – Eggs produced in 1990 (millions)
Y2 – Eggs produced in 1991 (millions)
X1 – Price per dozen (cents) in 1990
X2 – Price per dozen (cents) in 1991
library(ggplot2)
## Warning: package 'ggplot2' was built under R version 3.2.3
ggplot(egg_prod, aes(x=Y1, y=X1)) + geom_point() +
ylab("Price per dozen (cents) in 1990") +
xlab("Eggs produced in 1990 (millions)")
ggplot(egg_prod, aes(x=Y2, y=X2)) + geom_point() +
ylab("Price per dozen (cents) in 1991") +
xlab("Eggs produced in 1991 (millions)")
Fig 1. U.S. egg production plots
Comments
Post a Comment