Lab 2.2 – Scatterplots

Fundamental concept: Use x-y scatterplots to identify relationships between two variables 
Estimated time to complete
: 30 minutes
Preparation for: Lab 7, Lab 12
Materials needed: None

In Lab 2.1, we examined how properties such as temperature change over time with a time series graph. A scatterplot is a similar type of graph with an x axis and a y axis. Scatterplots are typically used to compare two variables and figure out if they are correlated with each other.

As a reminder, variables have a positive correlation (sometimes called a direct correlation) if one variable increases in value as the other variable increases. Here is an example:

Scatterplot graph with markers falling along a line that trends upward to the right. Horizontal axis labeled x variable (units). Vertical axis labeled y variable (units).

Variables have a negative correlation (sometimes called an inverse correlation) if one variable decreases in value as the other variable increases, such as in the graph below:

Scatterplot graph with markers falling along a line that trends downward to the right. Horizontal axis labeled x variable (units). Vertical axis labeled y variable (units).

Variables have no correlation if the points are randomly scattered with no apparent relationship:

Scatterplot graph with markers scattered throughout the graph. Horizontal axis labeled x variable (units). Vertical axis labeled y variable (units).

Orientation

As you may have learned in Lab 1, research vessels typically visit each OOI array once or twice a year to clean and swap instruments. We will use scatterplots to learn a little about these vessels.

The scatterplot graph below has datapoints representing the length from bow to stern and the largest width of six research vessels commonly used by OOI. Some of the ships were built with the same design and share a common length and width, so only four data points are visible on the graph.

Scatterplot graph with vessel width in feet on the y axis and vessel length in feet on the x axis. Four markers are visible. Vessel length varies from 238 to 275 feet. Vessel width varies from 50 to 52.5 feet. Vessel width increases as vessel length increases.

Figure 2.2.1. Scatterplot of vessel width versus length of six research vessels.

Answer these questions to check your understanding of the scatterplot in Figure 2.2.1

Interpretation

Let’s look at another characteristic of a research vessel. Scientists going out to sea might want to know how much lab space will be available on board for their equipment. What correlation do you see between the amount of science lab area and research vessel length in Figure 2.2.2 below?

Scatterplot graph with science lab area in square feet on the y axis and vessel length in feet on the x axis. Vessel length varies from 238 to 275 feet. Lab area varies from 1000 to 4000 square feet. Science lab area increases as vessel length increases, with variability in lab area among vessels of the same length.

Figure 2.2.2. Area of science labs in square feet compared to research vessel length.

Hopeful you noticed that there is a positive correlation, meaning that as the vessel length increases the area of science labs also increases.

To answer the questions about correlations in Figures 2.2.1 and 2.2.2, you might have imagined drawing a line to represent the trends in the data in Figures 2.2.1 and 2.2.2. We can use statistical tools to mathematically determine a “best fit” line. A best fit line is the one that minimizes the distance each data point falls away from the line. These lines help us visualize trends or relationships between variables. Check the examples in Figure 2.2.3.

Graph A is a scatterplot of vessel width versus vessel length with a trendline that has a positive slope. Markers fall on or close to the trendline. Graph B is a scatterplot of science lab area versus vessel length with a trendline that has a positive slope. Some of the markers are farther away from the trendline.

Figure 2.2.3. Scatterplots of (A) vessel width and (B) science lab area compared to vessel length. Dashed lines display the best fit linear trend.

The data points comparing vessel width and vessel length (Figure 2.2.3A) are all pretty close to the best fit line. The science lab area and vessel length data points (Figure 2.2.3B) are more scattered away from their best fit line. In other words, there is a stronger correlation between vessel width and length and a weaker correlation between science lab area and vessel length.

We will look at one more set of graphs related to research vessels. Review Figure 2.2.4 and answer the quick check questions below.

Scatterplot graph with fuel capacity in thousand gallons on the y axis and year built on the x axis. Fuel capacity varies from 140 to 280 thousand gallons. Year built varies from 1991 to 2014. Fuel capacity decreases as year increases with some variability in fuel capacity among vessels of the same age.

Figure 2.2.4. Capacity of each vessel’s fuel tanks in thousands of gallons compared to the year that the vessel was built.

Why do you think the vessels built more recently (in 2014) have lower fuel tank capacity? Often correlations between two variables are caused by some other variable (remember the adage “correlation is not equal to causation”?). We can introduce a third variable to our scatterplot by using color:

Scatterplot graph with fuel capacity in thousand gallons on the y axis and year built on the x axis. A colorbar displays vessel length in feet. Fuel capacity decreases as year increases, but colors indicate that older vessels have longer lengths and newer vessels have shorter lengths.

Figure 2.2.5. Capacity of each vessel’s fuel tanks in thousands of gallons compared to the year that the vessel was built, with color scale indicating the vessel length in feet.

By adding a color scale that represents the length of each vessel, we can see that the newest research vessels are also the smallest, and therefore it makes sense that they carry less fuel.

Application

Datasets from ocean observatories typically have many times more data points than the five research vessels. In Lab 2.1, you compared time series of sea surface temperature and salinity from the OOI Pioneer NES Array. We can also use a scatterplot to examine relationships between these two variables. Figure 2.2.6 contains data collected over one month. Each dot represents the temperature and salinity values measured at the surface of the ocean in a single hour (therefore, there are 744 data points in Figure 2.2.6).

Scatterplot with salinity in PSU on the y axis and temperature in degrees Celsius on the x axis. Salinity ranges from 30 to 35.5 PSU. Temperature ranges from 9 to 17 degrees Celsius. Some of the markers fall in lines but in multiple directions with no single trend.

Figure 2.2.6. Scatterplot of temperature and salinity measured hourly at the Pioneer NES Offshore Surface Mooring on May 1-31, 2018.

  1. What is the range in temperature of the data in Figure 2.2.5 (round to the nearest whole number)? What are the units of temperature?
  2. What is the range in salinity of the data in Figure 2.2.5 (round to the nearest whole number)? What are the units of salinity?

Is there a correlation between salinity and temperature in Figure 2.2.5? Although you might see some patterns in the scatterplot, the correlation over the whole month is weak. Let’s add a third variable: date within the month of May.

Scatterplot with salinity in PSU on the y axis and temperature in degrees Celsius on the x axis. A colorbar indicates dates between May 1, 2018 and May 31, 2018. Markers from some consecutive dates have positive trends, markers from other dates have negative dates, and yet other dates have no trend.

Figure 2.2.7. Scatterplot of temperature and salinity measured hourly at the Pioneer NES Offshore Surface Mooring with colorbar indicating date of measurement.

  1. Describe any changes in salinity and temperature by date that you observe in Figure 2.2.7:

To make it even easier to see relationships between salinity and temperature at the Pioneer NES array, we will zoom into two-day periods.

Two scatterplots with salinity in PSU on the y axis and temperature in degrees Celsius on the x axis. The scatterplot in panel A has a trendline that slopes upward to the right and all the markers are close to the line. The scatterplot in panel B has a trendline that slopes downward to the right and some of the markers fall far from the line.

Figure 2.2.8. Scatterplots of hourly temperature and salinity at the Pioneer NES Offshore Surface Mooring. (A) May 3-4, 2018. (B) May 17-18, 2018. Dashed yellow lines represent the best fit linear trend line.

  1. On May 3-4, 2018 (Figure 2.2.7A), what type of correlation do you see between salinity and temperature?
  2. On May 17-18, 2018 (Figure 2.2.7B), what type of correlation do you see between salinity and temperature?
  3. Which set of dates (May 3-4 or May 17-18) had the strongest correlation? How did you come to this conclusion?

Stay tuned for Lab 7 Water Masses to learn why the surface ocean can experience such dramatic changes in the relationship between temperature and salinity.

Reflection

  1. Scatterplots are useful graphs for identifying relationships between two variables. Think about variables you encounter in your everyday life. What are two things you could compare with a scatterplot?