daten <- read.csv("C:/Dokumente und Einstellungen/w6reto2/Desktop/desktopJena/teaching/empirie/data/phillips_2.csv",header=TRUE,sep=';') # sort the data daten_post1974 <- daten[daten$Year>1974,] daten_pre1970 <- daten[daten$Year<1970,] # show plot # plot(daten_post1974$CPI,daten_post1974$U, main = "Phillips curve", xlab = "X Achse (Unemployment rate)", ylab = "Y Achse (CPI change)") # plot(daten$CPI,daten$U, main = "Phillips curve", xlab = "X Achse (Unemployment rate)", ylab = "Y Achse (CPI change)") plot(daten_pre1970$CPI,daten_pre1970$U, main = "Phillips curve", xlab = "X Achse (Unemployment rate)", ylab = "Y Achse (CPI change)") # regression # result <- lm(CPI ~ U,data=daten_post1974) # result <- lm(CPI ~ U,data=daten) result <- lm(CPI ~ U,data=daten_pre1970) summary(result) abline(result$coef)