daten <- read.csv("/home/tobi/Desktop/Tobi/data/worldbank.csv", header=TRUE, sep=";") # Zeitreihenanalyse daten_D <- daten[daten$country=="Germany",] # Setup empty plot window plot(0, type = "n", main = "Unser Plot", xlab = "X Achse (Jahr)", ylab = "Y Achse", xlim = c(2000,2004), ylim = c(-1,40)) grid() # add grid lines(daten_D$year, daten_D$Exports, lty = 3) # draw Exports lines(daten_D[,1], daten_D[,3], lty = 1) # draw third dataset lines(daten_D[,1], daten_D[,4], lty = 2) # draw fourth dataset legend("topright", c("GDP growth", "Inflation", "Exports"), lty = c(1, 2, 3) ) result <- lm(GDP.growth ~ GDP,data=daten_D) summary(result) # Querschnittsanalyse daten_2003 <- daten[daten$year==2003,] plot(daten_2003$GDP,daten_2003$GDP.growth, main = "Year 2003", xlab = "X Achse (GDP)", ylab = "Y Achse (GDP growth)") abline(result$coef) result <- lm(GDP.growth ~ GDP,data=daten_2003) summary(result) # Panelanalyse # result <- lm(GDP.growth ~ factor(country) + GDP,data=daten) #FE result <- lm(GDP.growth ~ GDP,data=daten) summary(result) edit(daten)