Analyze Data With New Box Plots in Mathcad 15.0 and Prime 1.0

Mathcad’s New Box Plots

We’ve introduced three new plot types to both Mathcad 15 and Mathcad Prime 1.0. Box plots, effects plots, and Pareto plots provide quick visualization of data. Here’s how to make a box plot.

You may know box plots as box-and-whisker diagram. Box plots were first introduced by statistician John Tukey in his book, Exploratory Data Analysis, published in 1977 by Addison-Wesley.

Box plots display data very efficiently and enable quick scanning and comparison.

A box plot consists of several sections. A central box displays the middle 50% of the data, while the top and bottom of the box, or hinges, indicate the 25% and 75% percentiles. Each section is called a quartile. The line drawn across the box indicates the median value enabling you to quickly see when the median value skews high or low in the dataset.

The top of the vertical line or whisker indicates the maximum value, while the bottom whisker line displays the minimum value.

The spacing within the box shows how disperse the data is. The overall picture allows you to compare different data sets.

Box plots also display outliers by dots above and below the minimum data values. An outlier is any value that is more than 1.5 times the interquartile range above or below the endpoints of that range.

Creating a Box Plot

Enter a matrix for your data. Below is a sample data set of a surface. You can substitute your own data.

data set

Our sample data

Mathcad Prime 1.0 Box Plots

In Mathcad Prime 1.0, prepare the data to be plotted using the Mathcad Prime function, boxplot.

boxplot function

The boxplot function returns a matrix that you can use to generate box plots.

  • The first three rows represent the 25%, median, and 75% quartiles.
  • The third and fourth rows represent the minimum and maximum values of each data sets.
  • The last row displays any outliers. You can see that -3.04 is an outlier. The other cells in that row are filled with NaN’s (not a number).
result of boxplot function

Data to make a box plot

Set a column vector with the labels for each row of data. The labels must be strings.

Mathcad Prime Box Plot

  1. Insert an XY plot.
  2. Then enter the transposed matrix as the x-axis argument. To transpose a matrix, type Ctrl+Shift+T.
  3. Next add the labels as the y-axis argument.
  4. Finally click in one of the axis expressions, and select Plots tab > Change Type > Box Trace.

A box appears for each row of data.

Mathcad Prime Box Plot

Voila! A plot!

By comparing the data sets, you can see the variation between each data set. Note that the first two boxes, have very skewed data since the median value is not in the center of the box. The data in the last set is not as disperse as the other data sets.

Mathcad 15 Box Plots

Start from your dataset as a data table or matrix.

Data table

Plots can be created more directly in Mathcad 15

Prepare the data to be plotted using the Mathcad 15 function, boxplotgraph.

boxplotgraph function

The function boxplotgraph returns a nested vector of two elements that you can use to generate box plots.

 

nested vector

  1. Insert an X-Y plot.
  2. Then enter the first element as the x-axis argument using a matrix index to indicate the first element.
  3. Next add the second element as the y-axis argument.

A box appears for each data set.

Mathcad 15 Box Plot

The same result as before, but with less work

By comparing the data sets, you can see the variation between each data set. Note that the first two boxes have very skewed data since the median value is not in the center of the box. The data in the last set is not as disperse as the other data sets.

Go to the Mathcad Community website to use the Mathcad Prime 1.0 and Mathcad 15 worksheets as templates for visualizing your data as box plots.

About Alan Belniak

Alan Belniak likes most things digital. A self-proclaimed Web 2.0 kind of guy, Alan consumes various forms of digital media, tracks trends, follows the social networking space, and tries to make sense of it all. That's in his spare time. For 40 hours a week, Alan works at a major Boston-based software development company, where he is employed as the company's Director of Social Media Marketing. In this role, Alan works in a tactical and strategic fashion to find ways to use social media channels to better interact with customers, and to direct that feedback to R&D, marketing, sales, and the appropriate groups. The Subjectively Speaking blog is Alan's. It contains his opinions and observations and does not necessarily reflect those of his company or his company's customers or partners. To contact Alan, follow him on Twitter (@abelniak), make a comment in a post, or e-mail him at alan belniak gmail com.
This entry was posted in Tips & Tricks and tagged , , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s