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 dialog, you can customize your plots using the options in the dialog.
- 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.
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. TheBarplot
dialog will open (see Figure 9.1.Select your dataset from the Dataset dropdown menu. In this example, we select the cardata.
To create a barplot for numerical data, click on the
Numerical
tab.Move one or more numerical variables to the
Selected
column. We selected the variable HP.(Optional) Use the Factor 1 dropdown to select a categorical variable to compare the numerical variable between the levels of the selected variable.
(Optional) Select Conf. Bar to add confidence bars or Value Labels to add value labels to the bars.
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).
Click the Preview icon to see the barplot.
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.
- 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.
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. TheBoxplot
dialog will open Figure 9.3.Select your dataset from the Dataset dropdown menu. In this example, we select the cardata.
Move one or more numerical variables to the
Selected
column.(Optional) Move one or more factor variables to the
Selected
column.Click the Preview icon to see the graph.
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 to reorder the boxplots by reordering the levels of the selected categorical variables.
You can identify outliers by clicking on the button, and selecting the
Outlier
tab in the first section of the Graphs Settings dialog.
- 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.
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. TheBubbleplot
dialog will open (see Figure 9.5.Select your dataset from the Dataset dropdown menu. In this example, we select the cardata.
Select a Predictor (x) variable, a Response (y) variable, and a Bubble Size variable from the dropdowns.
Click the Preview icon to view the graph.
- 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.
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. TheDotplot
dialog will open (see Figure 9.7.Select your dataset from the Dataset dropdown menu. In this example, we select the Titanic dataset.
Select a variable from the Numerical Variables section and move it to the
Selected
column.(Optional) Select a variable from the Factor Variables section and move it to the
Selected
column.Click the Preview icon view the graph.
- 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.
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.Select your dataset from the Dataset dropdown menu. In this example, we select the cardata.
Select a Variable from the dropdown menu. Adjust the other options appropriately.
Click the Preview icon to view the graph.
An example of a Histogram Created by Rguroo
Additional Histogram options:
You can customize the bin breakpoints (classes). Click the , open the
Bins, Bars, Smoothing
section, and under theBins & Bars
section select a method for Bin Breakpoints. Click the help 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.
- 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.
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.Select your dataset from the Dataset dropdown menu. In this example, we select the AirPassengers dataset.
Select a Predictor (x) variable and a Response (y) variable from the dropdowns. Adjust the other options appropriately.
In the Superimpose section, select the option Line Graph.
Click the Preview icon to view the graph.
An example of a Line Graph Created by Rguroo
- 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.
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. TheMean Inference
dialog will open (see Figure 9.10).Select your dataset from the Dataset dropdown menu. In this example, we select the cardata.
Select a Variable from the dropdown.
Select the Normal Probability Plot checkbox.
Click the Preview icon to view the graph.
9.8 Scatterplot
- 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.
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. TheScatterplot
dialog will open (see Figure 9.12.Select your dataset from the Dataset dropdown menu. In this example, we select the cardata dataset.
Select a Predictor (x) variable and a Response (y) variable from the dropdowns.
(Optional) Select a categorical variable from the Factor dropdown.
(Optional) You can identify outliers, using an ID Variable by selecting the Outliers checkbox.
Click the Preview icon to view the graph.
An example of a Scatterplot Created by Rguroo
- 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.
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. TheStem and Leaf
dialog will open Figure 9.13.Select your dataset from the Dataset dropdown menu. In this example, we select the cardata.
Select a Variable from the dropdown.
(optional) In the Scale section, type a value in the Scale textbox. The default scale is 1.
Click the Preview icon to view the graph.
An example of a Stem and Leaf Plot Created by Rguroo
- 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.
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. TheTime Series
dialog will open Figure 9.15.Select your dataset from the Dataset dropdown menu. In this example, we select the AirPassengers dataset.
From the Numerical Variables section, select and drag the variable AirPassengers to the
Selected
column.(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}\) andMonth
to \(\tt{1}\).In the section Time Series Plot, select the Lines checkbox and optionally the Points checkbox.
Click the Preview icon to view the graph.
An example of a Time Series Plot Created by Rguroo