KNOWLEDGEBASE - ARTICLE #146

Calculating and graphing geometric means?

The geometric mean is used for distributions that are closer to a lognormal distribution than a Gaussian one.  Before reading on, you might wish to review logarithms and the use of logarithmic axes

When is it not possible to compute a geometric mean?

Note that it is not possible to compute a logarithm of zero or any negative number. Therefore, it is only possible to compute a geometrical mean when every value is positive and none are negative or zero.

What is the geometric mean?

To calculate a geometric mean by hand:

  1. Transform all the values to their logarithms.
  2. Compute the mean of the logaritms.
  3. Compute the antilog of the mean.

It doesn't matter what logarithm base you use, so long as you are consistent. If the logarithms in step 1 are common (base 10) logs, then the geometric mean in step 3 is computed by taking 10 to the power of the mean of the logarithms. If the logarithms in step 1 are natural, then step 3 is computed by taking e to that power. 

Example: graphing geometric means by columns

To create a graph in Prism displaying the geometric mean of a dataset along with its 95% confidence interval, start by selecting the Column table type on the Welcome dialog. For the graph in this example, choose the data table option "Enter or import data into a new table", and "Enter replicate values, stacked into columns".

After clicking "Create" add the following data to the data table:

Switch to the graph sheet, and the Change Graph Type dialog will appear. On this dialog, choose the "Scatter plot" option, and in the "Plot" dropdown menu, choose "Geometric mean with 95% CI", then click "OK". Note that the Y axis of this graph has a logarithmic scale. To create this scale, double-click on the Y axis to bring up the Format Axis dialog, then choose a logarithmic scale in the upper right of that dialog. The error bars appear visually symmetrical, which means they are numerically far from symmetrical. By reading off the coordinates corresponding to the top and bottom of the error bar, this is apparent. The bottom half of the first (control) error bar extends down from about 35 down to 10. The upper half extends from 35 up to 150, a much longer range of values on a linear scale but the same distance on a logarithmic scale.

To calculate the geometric mean values for columns of data:

From your data table, click the Analyze button and select Descriptive Statistics.

Check the box to report Geometric means.

The values will be on your results sheet.

Graphing the geometric mean of side-by-side replicates in grouped or XY graphs

 If you enter your data as grouped data, It is not possible to directly plot the geometric mean of the rows. But you can still calculate and plot your data with geometric means. Here is what you need to do:

Enter your data

Then click Analyze and transform the data to logs.

When you do the transform, tell Prism to make a new graph of the resuts. You'll see the graph shown on the left below. The Y axis values are logarithms. To make the graph on the right, double-click on the Y axis to bring up the Format Axis dialog. Change the Number Format to Antilog, and choose nine minor ticks (log spaced). The graph on the right plots the geometric means on a log scale.

 

Click here to see this file.

Calculating the geometric mean of grouped data

To compute the geometric mean for rows, first transform the individual data values to logs, then compute the mean of the logs, then compute the antilog of those means. For example, suppose you want to find the geometric means for these six rows of data:

Click Analyze and use Prism's built-in transform Y=(LogY) to produce the following Results sheet:

Now perform a "Row Statistics" analysis on that Results sheet. Click Analyze and choose Row statistics from the list of Grouped analyses. You can can accept the default parameters for this analysis. This produces a new Results sheet with the mean values, as well as SEM and N values that you will ignore:

Finally, from this results sheet, click Analyze and Transforms and use the built-in transform Y=10^Y (antilog) to obtain the geometric means for each row:

If you answered the question,  "When it is impossible to transform a SD or SEM..." with the answer "Convert to an asymmetric 95% confidence interval", the results would have included the confidence interval of the geometric mean, as well as the geometric mean itself.

Explore the Knowledgebase

Analyze, graph and present your scientific work easily with GraphPad Prism. No coding required.