Balasubrahmanyam Juttiga
02/09/2017
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:
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
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)
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