9 Plots for Numerical Data

This section gives Rguroo instructions for plots that display numerical data, including plots of numerical variables by categorical variables. All plots in Rguroo are highly customizable. In addition to the options in the Basics button dialog, you can customize your plots using the options in the Details button dialog.

9.1 Barplot for Numerical Variables

Instructional video iconInstructional video iconUsers guide icon

  1. Use a dataset in your Rguroo account or recreate the example below by importing the cardata dataset from the Rguroo dataset repository called Rguroo Users Guide into your account.
Click here to see a portion of the dataset. Screenshot of the first 5 rows of the Cardata dataset.
  1. Open the Plots toolbox on the left-hand side of the Rguroo window. Click on the Create Plot dropdown menu and choose the Barplot function. The Barplot dialog will open (see Figure 9.1.

  2. Select your dataset from the Dataset dropdown menu. In this example, we select the cardata.

  3. To create a barplot for numerical data, click on the Numerical tab.

  4. Move one or more numerical variables to the Selected column. We selected the variable HP.

  5. (Optional) Use the Factor 1 dropdown to select a categorical variable to compare the numerical variable between the levels of the selected variable.

  6. (Optional) Select Conf. Bar to add confidence bars or Value Labels to add value labels to the bars.

  7. From the Function dropdown, select a function to be applied to the selected numerical variable(s). The default function is Mean, which computes mean of the selected variable(s).

  8. Click the Preview icon preview icon to see the barplot.

Screenshot of Barplot dilog for numerical variables.

Figure 9.1: Barplot dialog for numerical variables.

An example of a Barplot for a numerical variable.
Screenshot of a barplot displaying the horse power of cars by types of domestic and import.

Figure 9.2: An example of a Barplot for a numerical variable.

Additional options:

  • You can add confidence bars to the barplot by selecting the Conf. Bar checkbox.

  • You can add value labels to the bars by selecting the Value Labels checkbox.

  • you have options of side-by-side and stacked barplot.

  • You can apply functions such as mean, median, sum, count, and proportion using the Function dropdown.

9.2 Boxplot

Instructional video iconUsers guide icon

  1. Use a dataset in your Rguroo account or recreate the example below by importing the cardata dataset from the Rguroo dataset repository called Rguroo Users Guide into your account.
Click here to see a portion of the dataset. Screenshot of the first 5 rows of the Cardata dataset.
  1. Open the Plots toolbox on the left-hand side of the Rguroo window. Click on the Create Plot dropdown menu and choose the Boxplot function. The Boxplot dialog will open Figure 9.3.

  2. Select your dataset from the Dataset dropdown menu. In this example, we select the cardata.

  3. Move one or more numerical variables to the Selected column.

  4. (Optional) Move one or more factor variables to the Selected column.

  5. Click the Preview icon preview icon to see the graph.

Screenshot of Boxplot dilog.

Figure 9.3: Boxplot dialog.

An example of a Boxplot Created by Rguroo
Screenshot of side-by-side boxplots displaying the MPG of cars by class.

Figure 9.4: An example of a Boxplot.

Additional Boxplot options: - You can display the mean on boxplots by selecting the Show Mean checkbox.

  • You can draw horizontal boxplots by selecting the Horizontal checkbox.

  • You can use the Level Editor level editor button to reorder the boxplots by reordering the levels of the selected categorical variables.

  • You can identify outliers by clicking on the Details button button, and selecting the Outlier tab in the first section of the Graphs Settings dialog.

9.3 Bubble Plot

Users guide icon

  1. Use a dataset in your Rguroo account or recreate the example below by importing the cardata dataset from the Rguroo dataset repository called Rguroo Users Guide into your account.
Click here to see a portion of the dataset. Screenshot of the first 5 rows of the Cardata dataset.
  1. Open the Plots toolbox on the left-hand side of the Rguroo window. Click on the Create Plot dropdown menu and choose the Bubbleplot function. The Bubbleplot dialog will open (see Figure 9.5.

  2. Select your dataset from the Dataset dropdown menu. In this example, we select the cardata.

  3. Select a Predictor (x) variable, a Response (y) variable, and a Bubble Size variable from the dropdowns.

  4. Click the Preview icon preview icon to view the graph.

Rguroo Dialog
Screenshot of Bubbleplot dilog.

Figure 9.5: Bubbleplot dialog.

An example of a Bubbleplot Created by Rguroo
Screenshot of a bubbleplot displaying MPG by HorsePower, with Weight as the bubble size.

Figure 9.6: An example of a Bubbleplot.

9.4 Dotplot

Instructional video iconUsers guide icon

  1. Use a dataset in your Rguroo account or recreate the example below by importing the Titanic dataset from the Rguroo dataset repository called R Datasets into your account.
Click here to see a portion of the dataset. Screenshot of the first 5 rows of the Cardata dataset.
  1. Open the Plots toolbox on the left-hand side of the Rguroo window. Click on the Create Plot dropdown menu and choose the Dotplot function. The Dotplot dialog will open (see Figure 9.7.

  2. Select your dataset from the Dataset dropdown menu. In this example, we select the Titanic dataset.

  3. Select a variable from the Numerical Variables section and move it to the Selected column.

  4. (Optional) Select a variable from the Factor Variables section and move it to the Selected column.

  5. Click the Preview icon preview icon view the graph.

Screenshot of Dotplot dilog.

Figure 9.7: Dotplot dialog.

An example of a Dotplot Created by Rguroo
Screenshot of a dotplot displaying the age distribution of Titanic passengers..

(#fig:DotplotExample_Output2)An example of a Dotplot.

9.5 Histogram

Instructional video iconUsers guide icon

  1. Use a dataset in your Rguroo account or recreate the example below by importing the cardata dataset from the Rguroo dataset repository called Rguroo Users Guide into your account.
Click here to see a portion of the dataset. Screenshot of the first 5 rows of the Cardata dataset.
  1. Open the Plots toolbox on the left-hand side of the Rguroo window. Click on the Create Plot dropdown menu and choose the Histogram function. The Histogram dialog will open (see Figure 9.8.

  2. Select your dataset from the Dataset dropdown menu. In this example, we select the cardata.

  3. Select a Variable from the dropdown menu. Adjust the other options appropriately.

  4. Click the Preview icon preview icon to view the graph.

Screenshot of Histogram dilog.

Figure 9.8: Histogram dialog.

An example of a Histogram Created by Rguroo Screenshot of a histrogram displaying MPG of cars.

Additional Histogram options:

  • You can customize the bin breakpoints (classes). Click the Details button, open the Bins, Bars, Smoothing section, and under the Bins & Bars section select a method for Bin Breakpoints. Click the help icon help button icon to see descriptions of various methods.

  • You can draw histograms for levels of a categorical variable by selecting a categorical variable from the Factor dropdown.

  • You can choose one of the options of Frequency, Relative Frequency, or Density histogram.

  • You can superimpose your histogram with value labels, density curve, and normal curve.

9.6 Line Graph

  1. Use a dataset in your Rguroo account or recreate the example below by importing the AirPassengers dataset from the Rguroo dataset repository called R Datasets into your account.
Click here to see a portion of the dataset. Screenshot of the first 5 rows of the air passenger dataset.
  1. Open the Plots toolbox on the left-hand side of the Rguroo window. Click on the Create Plot dropdown menu and choose the Scatterplot function. The Scatterplot dialog will open (see Figure 9.9.

  2. Select your dataset from the Dataset dropdown menu. In this example, we select the AirPassengers dataset.

  3. Select a Predictor (x) variable and a Response (y) variable from the dropdowns. Adjust the other options appropriately.

  4. In the Superimpose section, select the option Line Graph.

  5. Click the Preview icon preview icon to view the graph.

Screenshot of scatterplot dilog.

Figure 9.9: Line Graph dialog.

An example of a Line Graph Created by Rguroo

Screenshot of a line graph showing the number of airline passengers over time.

9.7 Normal Probability Plot

  1. Use a dataset in your Rguroo account or recreate the example below by importing the cardata dataset from the Rguroo dataset repository called Rguroo Users Guide into your account.
Click here to see a portion of the dataset. Screenshot of the first 5 rows of the Cardata dataset.
  1. Open the Analytics toolbox on the left-hand side of the Rguroo window. Click on the Analysis dropdown menu and choose the Mean Inference —> One Population function. The Mean Inference dialog will open (see Figure 9.10).

  2. Select your dataset from the Dataset dropdown menu. In this example, we select the cardata.

  3. Select a Variable from the dropdown.

  4. Select the Normal Probability Plot checkbox.

  5. Click the Preview icon preview icon to view the graph.

Screenshot of Mean Inference dilog.

Figure 9.10: Normal Probability Plot dialog.

An example of a Normal Probability Plot Created by Rguroo
Screenshot of a normal quantile-quantile plot.

Figure 9.11: An example of a Normal Probability Plot.

9.8 Scatterplot

Instructional video iconUsers guide icon

  1. Use a dataset in your Rguroo account or recreate the example below by importing the cardata dataset from the Rguroo dataset repository called Rguroo Users Guide into your account.
Click here to see a portion of the dataset. Screenshot of the first 5 rows of the Cardata dataset.
  1. Open the Plots toolbox on the left-hand side of the Rguroo window. Click on the Create Plot dropdown menu and choose the Scatterplot function. The Scatterplot dialog will open (see Figure 9.12.

  2. Select your dataset from the Dataset dropdown menu. In this example, we select the cardata dataset.

  3. Select a Predictor (x) variable and a Response (y) variable from the dropdowns.

  4. (Optional) Select a categorical variable from the Factor dropdown.

  5. (Optional) You can identify outliers, using an ID Variable by selecting the Outliers checkbox.

  6. Click the Preview icon preview icon to view the graph.

Screenshot of Scatterplot dilog.

Figure 9.12: Scatterplot dialog.

An example of a Scatterplot Created by Rguroo

Screenshot of a scatterplot of the number of airpline passengers over time.

9.9 Stem and Leaf Plot

Users guide icon

  1. Use a dataset in your Rguroo account or recreate the example below by importing the cardata dataset from the Rguroo dataset repository called Rguroo Users Guide into your account.
Click here to see a portion of the dataset. Screenshot of the first 5 rows of the Cardata dataset.
  1. Open the Plots toolbox on the left-hand side of the Rguroo window. Click on the Create Plot dropdown menu and choose the Stem and Leaf function. The Stem and Leaf dialog will open Figure 9.13.

  2. Select your dataset from the Dataset dropdown menu. In this example, we select the cardata.

  3. Select a Variable from the dropdown.

  4. (optional) In the Scale section, type a value in the Scale textbox. The default scale is 1.

  5. Click the Preview icon preview icon to view the graph.

Rguroo Dialog
Screenshot of Stem-and-Leaf dilog.

Figure 9.13: Stem and Leaf dialog.

An example of a Stem and Leaf Plot Created by Rguroo

Screenshot of a stem and leaf plot showing the miles per gallon of vehicle.

Figure 9.14: An example of a Stem and Leaf Plot.

9.10 Time Series Plot

  1. Use a dataset in your Rguroo account or recreate the example below by importing the AirPassengers dataset from the Rguroo dataset repository called R Datasets into your account.
Click here to see a portion of the dataset. Screenshot of the first 5 rows of the Cardata dataset.
  1. Open the Analytics toolbox on the left-hand side of the Rguroo window. Click on the Analysis dropdown menu and choose the Time Series function. The Time Series dialog will open Figure 9.15.

  2. Select your dataset from the Dataset dropdown menu. In this example, we select the AirPassengers dataset.

  3. From the Numerical Variables section, select and drag the variable AirPassengers to the Selected column.

  4. (Optional) Under the Time Specification section, from the Type dropdown, select the time frequency of your data (yearly, quarterly, monthly, daily, hourly, by minute, or seconds). The AirPassengers data are monthly, so we select Month from the Type dropdown menu. Then set an appropriate start month and year for the data. The AirPassengers data starts from January 1949, so set Year to \(\tt{1949}\) and Month to \(\tt{1}\).

  5. In the section Time Series Plot, select the Lines checkbox and optionally the Points checkbox.

  6. Click the Preview icon preview icon to view the graph.

Screenshot of Time Series dilog.

Figure 9.15: Time Series dialog.

An example of a Time Series Plot Created by Rguroo

Screenshot of a time plot showing the number of airline passengers over time.

Figure 9.16: An example of a Time Series Plot.