If you deal with something like this, then this package is for you:
More then 30,000,000 people in the USA suffer from hearing loss, mostly the elderly, >80% at 85 years old or above. For more background and details on epidemiology see http://dx.doi.org/10.4236/ijohns.2013.24025 . Treatment is of utmost importance and great progress has been made in understanding, detecting as well as treating different conditions that lead to hearing loss, yet the situation is often dissatisfying and just a glance at the numbers of the affected, the huge impact on their lives and cost of some treatment options like cochlear implants serve as proof, that the topic deserves further research.
Among the many approaches to measure hearing loss, pure tone audiometry (PTA) clearly plays the most important role, up to the point, where laymen call pure tone audiometry just “hearing test”.
In the simplest form, a patient is given headphones, sinus tones in different frequencies are played at different intensities and hearing thresholds are marked in a standardized diagram. Results are usually communicated visually via this diagram and thus it is only natural, to use the same diagram standards in scientific publication of pure tone audiometric data.
There is an ISO standard ISO 8253-1:2010(en) that is not open, so the author could not refer to it. The American Speech-Languge-Hearing Association (ASHA) has published their guidelines openly ( https://www.asha.org/policy/GL2005-00014/#sec1.8 ) where they state:
When the graphic form is used, the test frequencies shall be recorded on the abscissa, indicating frequency on a logarithmic scale, and hearing levels shall be recorded on the ordinate, using a linear scale to include the units of decibels. The aspect ratio of the audiogram is important for standardization. The correct aspect ratio is realized when a square is formed between any given octave pair on the abscissa and any 20 dB increment on the ordinate. For conventional audiometry, the vertical scale is to be designated hearing level in decibels; the horizontal scale is to be labeled frequency in hertz. By convention, frequency is recorded in ascending order from left to right, and hearing level is recorded in ascending order from top to bottom, ranging from a minimum value of −10 dB to the maximum output limits of the audiometer (usually 110 or 120 dB HL).
Whilst regarding all these rules is obviously possible in ggplot2 it is not necessarily easy nor will every scientist in the field of hearing research always have these rules in mind.
That is, why the audiometry package provides an easy way to prepare a suitable ggplot object to start building diagrams on.
First, we define some example data with no particular meaning except for showing the functionality.
When starting a ggplot2 graphic, you usually start by calling ggplot with a data.frame as in
Instead we will start a pure-tone-audiogram-like plot with
This will prepare our form. In the next step we need to add geoms to put our data into the form. Now this is all done with standard ggplot2 commands. In our case, let’s assume we optained a 6 frequency pure tone audiogram of a patient with sudden sensoryneural hearing loss in the deep frequencies at three different points in time: onset, two weeks and four weeks later, when she had totally recovered. We call gg_pta as our basis, then we add points with geom_point and lines with geom_line where line type and color represent the three points in time:
There are two ways to make changes to this plot. Either through gg_pta itself or employing all the manyfold possbilities ggplot2 offers the adept. If you wanted to change the language of the axis labels and the axis limits and the extra line at 0 dB to disapear, that can easily be done when calling gg_pta:
All the possible arguments to gg_pta are in the manual, just type help(gg_pta)
There is a number of ways to mark a side in PTA. gg_pta has a shortcut by means of the lettermark argument, which adds an “R” or “L” or both in size lettermarksize to the audiogram
Obviously, for the ggplot2 savy, everything can be changed. Here are some examples with a randomly generated data set.
In order to decide, whether insurances will pay for hearing aids, German ENT specialists have to check, whether at least two thresholds in between 0.5 kHz an 4 kHz are 30 dB or louder. That decision line is easily visualized:
The package name audiometry is obviously much wider then just pure tone audiogram forms. I intend to broaden the package’s functionality slowly over time. As of now the audiometry packages has support for the Freiburger Sprachtest which is a widely used speech audiometry test in German speaking countries.
– Bernhard Lehnert