Longleys Economic Data Anlaysis: Predicting Employment with GNP

Balasubrahmanyam Juttiga
02/09/2017

About the Dataset

Macroeconomic data set with economical variables such as employment,GNP,population , observed yearly from 1947 to 1962

This provides a well-known example for a highly collinear regression.

Two variables are used from this data set:

  • Employment: Number of people employed
  • GNP: Gross National Product

Summary Of Variables

This summary has two variables: GNP and Employment

library(datasets)
summary(cbind(longley$Employed,longley$GNP))
       V1              V2       
 Min.   :60.17   Min.   :234.3  
 1st Qu.:62.71   1st Qu.:317.9  
 Median :65.50   Median :381.4  
 Mean   :65.32   Mean   :387.7  
 3rd Qu.:68.29   3rd Qu.:454.1  
 Max.   :70.55   Max.   :554.9  

Scatter Plot

It has two variables Employment and GNP.We can see linear relationship on these variables. Selected Year can be shown dynamically aboe ve the plot

plot(longley$Employed,longley$GNP)

plot of chunk unnamed-chunk-2

Linear Regression Model

A linear regression is developed using Employment as dependent variable and GNP as independent variable.

reg=lm(longley$Employed~longley$GNP)
coef(reg)
(Intercept) longley$GNP 
51.84358978  0.03475229