The graphs discussed so far are useful for visualizing individual time series. It is also useful to explore relationships between time series.
Figure 2.7 shows two time series: monthly takings (in $million) from accommodation at hotels, motels and guest houses in Victoria (top) and total room nights for each corresponding month (in thousands). “Room nights” is the total number of rooms booked multiplied by the number of nights people stayed in those rooms.
autoplot(motel[,2:1]/1000, facet=TRUE) + xlab("Year") + ylab("") + ggtitle("Total monthly accommodation: Victoria, Australia")
We can study the relationship between takings and room nights by plotting one series against the other.
qplot(Roomnights/1000, Takings/1000, data=as.data.frame(motel)) + ylab("Takings ($million)") + xlab("Room nights (thousands)")
This scatterplot helps us to visualize the relationship between the variables.