3
$\begingroup$

I've tallied the number of glands in a plant this year and last year. My full data set has about 20 plants in it (I've reproduced the data from 10 of the plants here). I want to show that the plants this year have had consistently lower gland counts than they did last year, but I don't want to bog readers down with too many data points in their faces. What kind of graph/chart should I use to best show this trend?

        Gland Count
PlantID  2015    2016
1        22.92   19.50
2        11.67   7.12
3        19.67   15.33
4        22.33   12.00
5        20.92   18.58
6        25.83   23.83
7        25.67   32.17
8        22.83   17.00
9        28.42   26.25
10       17.92   16.92
$\endgroup$

closed as primarily opinion-based by Remi.b, rg255, March Ho, WYSIWYG Jul 22 '16 at 10:55

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.

  • $\begingroup$ I'd highly recommend this PloS perspective article: "Beyond Bar and Line Graphs: Time for a New Data Presentation Paradigm". @Shawn is on the right lines with their answer. $\endgroup$ – James Jul 17 '16 at 15:39
  • 3
    $\begingroup$ IMO, this question is off-topic as it is about data visualization and not biology. I am voting to close. $\endgroup$ – Remi.b Jul 20 '16 at 17:45
  • 1
    $\begingroup$ @Remi.b I agree it is off-topic here,, but it might be on-topic for Cross Validated. Migrate? $\endgroup$ – RHA Jul 21 '16 at 7:09
  • $\begingroup$ @RHA This is not a statistics question either. Not suitable there as well. I am not sure which site would actually be suitable because usually questions like this are opinion-based. $\endgroup$ – WYSIWYG Jul 22 '16 at 10:54
  • $\begingroup$ @WYSIWYG "Cross Validated is a Q&A site for people interested in statistics, machine learning, data analysis, data mining and data visualization." $\endgroup$ – RHA Jul 22 '16 at 21:24
2
$\begingroup$

One solution is to plot exactly the data you are trying to describe - the delta in your values.

Consider a bar-plot (with confidence/error bars) showing the plant number along the x-axis and the y-axis showing the change in count with +ve and -ve values.

For example, using the data from your question, this visualisation shows clearly that all values bar one decreased from 2015 to 2016 (please forgive the crude diagram lacking titles etc): enter image description here

Of course it would also be helpful to show a graph of the absolute values and it is obligatory to include a table of the exact values too.

$\endgroup$
  • $\begingroup$ Just had a few mins spare so have added a sample bar chart created trivially in Google sheets via mobile to more clearly show what I tried to describe using text. I'm willing to spend more time creating a less crudely drawn chart if this considered suitable for the OP's purposes. $\endgroup$ – kwah Jul 19 '16 at 1:37
3
$\begingroup$

Two styles of graph come to mind.

  1. A simple 2 layer histogram showing the distribution of gland counts for each year. This is a kernel density as opposed to a histogram, but it gets the idea across. kernel density graph

  2. Line graph with year on the x-axis and gland count on the y-axis, with a colored line for each plant. This would show a little more detail, and would be better if the mean gland count overall did not change much, but decreased significantly among individuals. line graph

$\endgroup$
  • $\begingroup$ The line plots look great and are a very nice and direct way for showing trend for individual plants. However, care must be taken when expanding to n~20 that the graph does not become too crowded [especially when (print)size might be small]. $\endgroup$ – tsttst Jul 17 '16 at 15:40
  • 2
    $\begingroup$ Histograms are a poor choice here due the data not being neither continuous nor ordered (I presume the plant IDs are arbitrary and there is no "plant 1.5"). Overlaying bars could be a reasonable alternative if you can ensure the colours used clearly distinguish between the years. $\endgroup$ – kwah Jul 19 '16 at 1:41
  • 1
    $\begingroup$ I agree with the points that @tsttst raises and would add that this style of chart relies on the points/lines being visually distinct but does enable expansion to show data for a third/fourth etc year which is a definite bonus. One alteration to the example would be to also have different shapes (rather than only circles) as well as different colours to help with distinguishing which colour relates to a specific plant number. $\endgroup$ – kwah Jul 19 '16 at 1:46
1
$\begingroup$

Ensure that the visualization will not be misleading (if you intend to use visualization to argue in favor of a consistent reduction):

  • Count the number of plants, where the Gland Count would be lower in 2016 than in 2015 (to ensure that is lower for most plants).
  • Then perform a two-sided paired non-parametric test, such as the Wilcoxon signed-rank test, (to test that for most plants there was a change in the same direction), and provide the p-value.

Visualization:

  • Divide 2016 values of each plant by the 2015 value of the same plant, (perhaps log2-transform), and only plot the resulting values as individual dots along the y-axis, (perhaps add some background shading or line to indicate the boundary between reduction and increase of Gland Count, if it helps the visual understanding)
  • In case that you are preparing a publication: consider whether the limited gain of information (compared to representation by p-values or a supplemental table) is worth the space
$\endgroup$
  • $\begingroup$ @Jennser: With 20 individuals you could also think about a bootstrapping approach to calculate 95% confidence intervals for the means and/or medians for each year. $\endgroup$ – AlexDeLarge Jul 15 '16 at 18:55
  • $\begingroup$ @tsttst. Hi. My background in statistics is not very strong, so forgive me if this question is very basic. I performed a two-tailed paired t-test already on the data to ensure that there was a statistically significant change in gland counts between the two years. Does the Wilcoxon signed-rank test provide substantially different information from the t-test/ would it be more appropriate do use for some reason? $\endgroup$ – Jennser Jul 15 '16 at 21:13
  • $\begingroup$ Hi Jennser, actually this is an excellent question (especially as Alex had hinted at your sample size, which might allow further statistical tests). t-test assumes an underlying normal distribution of the gland counts. Unless there are safe reasons to assume such a distribution (or you can convincingly show its presence), it is better to be conservative, and use the Wilcoxon signed-rank test, which does not depend upon this assumption. -> Wilcoxon signed-rank means that there will be one thing less to worry about (it yields p=0.06 on the 10 plants, and will likely get even better on 20) $\endgroup$ – tsttst Jul 16 '16 at 0:01
1
$\begingroup$

Simple comparison of averages

The easiest and most common is to display the mean and standard error for each year.

enter image description here

If you have more years, you might then want to add indication on the graph corresponding to p.values of pairwise comparisons but I don't think you have more than two years.

Below is a short R code that does the job. Note that I estimated the standard error with bootstrap. You might want to switch to use Agresti-Coull method. Personally, I like bootstrap. Make sure to use the standard errors that make sense given the statistical test you performed on these data.

# Function to calculate the standard error
bootstrap_SE = function(x,reps=1e5, SEorCI="SE")
{
    means = vector("numeric",reps)
    for (rep in 1:reps)
    {
        means[rep] = mean(sample(x,replace=TRUE))
    }
    if (SEorCI == "SE") return ( sqrt(var(means)) ) 
    if (SEorCI == "CI") return ( quantile(means, c(0.025,0.975)) ) 
}

# Your data
d2015 = c(19.50, 7.12, 15.33, 12.00, 18.58, 23.83, 32.17, 17.00, 26.25, 16.92)
d2016 = c(22.92, 11.67, 19.67, 22.33, 20.92, 25.83, 25.67, 22.83, 28.42, 17.92)

# Calculate the averages
yAverages = c(mean(d2015),mean(d2016))

# Calculate standard errors
SE = c(bootstrap_SE(d2015),bootstrap_SE(d2016))

# x-axis
x = c(2015,2016)

# Make the plot
plot(y=yAverages,x=x, xlab="year", ylab="gland count", ylim=c(min(yAverages-SE),max(yAverages+SE)), xlim = c(2014.4,2016.5), xaxp=c(2015,2016,1))
arrows(
    x0=x,
    y0=yAverages,
    x1=x,
    y1=yAverages+SE,
    angle=90
)
arrows(
    x0=x,
    y0=yAverages,
    x1=x,
    y1=yAverages-SE,
    angle=90
)

Focus on systematic differences

If your goal is to insist on the existence of systematic differences for each plant, then I would recommend @kwah's solution (+1). I don't quite like @Shawn's solution (no offense), I found the graphs complicated, unintuitive for categorical variables and I found that they do a poor job to convey the concept of systematic differences in comparison to @kwah's solution.

If you're thinking at doing a paired-test, then going with @kwah's solution sounds like a clever idea.

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.