As a new user of Rstudio I am quite lost and my data I have entered does not seem to be bringing up accurate empirical results or strong correlation. Help would be so greatly appreciated!!
I have used GDP as my dependent variable for an assignment with CPI, unemployment rate and LT Interest rate in Ireland between 1993-2012 in percentage change units. It is giving me very uncorrelated data and not much to work with. Please help!!! All commands are posted below.
Data <- read.csv("~/aaaaa 4th year sem 2/Monetary Economics EC4018/Data.csv")
View(Data)
head(Data)
str(Data)
as.data.frame(Data)
getwd()
names(Data) <- c("years", "GDP", "CPI", "LTIR", "unemp")
View(Data)
nrow(Data)
ncol(Data)
Observation of key variables:
summary(Data)
Correlation:
cormatrix = cor(Data[1:80, 2:5])
library(corrplot)
corrplot(cormatrix, method = "number")
Relationships between variables:
ggplot(Data,aes(x = Data$GDP,y = Data$CPI))+
- geom_point(colour = "red")+
- geom_smooth(method = "lm", se = FALSE)+
- ggtitle("Relationship between GDP and CPI from 1993-2012")+
- xlab("GDP")+
- ylab("CPI")+
- theme_bw()
ggplot(Data,aes(x = Data$GDP,y = Data$years))+
- geom_point(colour = "red")+
- geom_smooth(method = "lm", se = FALSE)+
- ggtitle("GDP percentage change from 1993-2012")+
- xlab("GDP")+
- ylab("Year")+
- theme_bw()
**edit the variables and title for each variable
Regression:
ModCPI <- lm(GDP ~ CPI, data = data)
print(ModCPI)
ModLTIR <- lm(GDP ~ LTIR, data = data)
print(ModLTIR)
Modunemp <- lm(GDP ~ unemp, data = data)
print(Modunemp)
ModE <- lm(GDP ~ CPI + LTIR + unemp, data = data)
print(ModT)
View(ModCPI)
View(ModLTIR)
View(Modunemp)
View(ModT)
summary(ModE)
pander(summary(ModE))