P. D. Bolier
23 november 2016
Is there a relation between the number of cars (passenger cars) and:
For simplicity reasons we left out:
The data is retrieved form the central bureau for statistics (http://statline.cbs.nl). The original idea was to use data from 1900..2016. Although some data was found not all the expected data was available despite the possible queries. So the data is merged with data from other sources, such as wiki pages etc.
cars <- read.csv("data/cbs_merged_traffic_people-mixed.csv", sep=";")
cars$Infrastructuur.Lengte.bevaarbare.rivieren.en.kanalen.Totaal <- NULL # drop channels/boats
cars <- na.omit(cars)
colnames(cars) <- c("year", "population", "roadlength", "railroadlength", "cars1jan")
As a first attempt three simple models (lm) are used: one where only the population is used, one where population and the total lenght of the roads is used and one where population, total lenght of the road and the total lenght of the railroad are used.
population <- max(cars$population)
roadlength <- max(cars$roadlength)
railroadlength <- max(cars$railroadlength)
model_pop <- lm(cars1jan ~ population, data = cars)
model_pop$coefficients
(Intercept) population
-1.679001e+07 1.464285e+00
where cars1jan is the number of cars on january the first for a given year and population is the population for a given year.
Either the data does not capture all necessary factors or the growth of the number of cars would be much larger without the railroads.
Application to be found at: Shiny app: http://peterbolier.shinyapps.io/PeopleAndCars/ Github : http://github.com/peter–bolier–zero/PeopleAndCars