So far in this course, we've cared a lot about frequencies, frequencies across categories, frequencies across classes. But what if we care more about how data is changing over time as opposed to how it's changing across groups? So far, we haven't had a great way to display that type of data, but that's where the time series graph comes in. Time series graphs are great options for displaying how a variable's value changes over time, and I think you'll see that in this video. The data on a time series graph are coordinate pairs, so that means we have an x and a y.
To plot that type of point, we head to a grid. We go across x, up y, plot where we land, and then we're all set. For time series graphs, x will give us the time and y will give us the value measured at that time. Once we have all of our points plotted, we're going to connect them with segments, much like we see over here. The reason we do that is so that we can clearly see trends in our data, and some of the trends we care most about are increases and decreases in our dataset.
As we can see over here, it looks like our data's decreasing because we are heading down as we go. Alright. Let's take a peek at our example and create our own time series graph. In our example, we're given data about the average daily ice cream sales each month over the course of a year. And when we see over the course of time interval, then we know that we're measuring data over time, which means a time series graph is a great option for displaying that data.
We are in fact gonna create a time series graph, and we're gonna use it to look for trends. So we're gonna see, hey. When are sales increasing and when are they decreasing? Cool. Now I can see over here that x is in fact time. It's it's months, and I can see that the month number is increasing. So I am measuring data over a span of time. I wanna make sure that my x axis is labeled for months and that I choose a scale that allows me to see the entire range of time over which I measure data. So I'm gonna start with month one and just increment by ones here so, again, I'll be able to see the entire span over which I measured data. Perfect.
My y gives me the sales, which is what I measured at each month. Now my y axis is already all set to show me the sales, so I'm ready to start plotting points. It looks like in month one, the average daily ice cream sales were three. So that gives me the point 1,3. To plot that point, I'm gonna go across one and up three and then just plot where I land.
I'm gonna do that for each of my months. So it looks like in month two, average sales were two cones per day. So I'm going to plot the point 2,2. Looks like my next point is 3,4 followed by 4,6, 5,8, and 6,14. As you can see, the rest of my points have already been added to the graph, but feel free to verify that they're in the right place by checking with the table.
Perfect. Now I'm just gonna connect those points using segments so that I'll be able to clearly see trends in my data. And, again, we wanna look for periods of increase or decrease. For periods of increase, I should be heading up, and for periods of decrease, I should be heading down. Looking at my graph, I can see that I'm heading up from month two to month seven.
So that's gonna give me a period of increasing. But it doesn't look like sales are increasing at any other place in my graph. For decreasing, I should be heading down. And I can see here it looks like I'm heading down from month one to month two, and it also looks like I'm heading down from month seven to month twelve. So it looks like I have another period of decrease from month seven to month twelve.
Awesome work. Now that we've created our time series graph and analyzed it for trends, I think you're ready to head over to the practice. Best of luck.