
Second, using these principles, we create the Draw Datapoints on Graphs (DDoG) measure, which collects drawn readouts (concrete, detailed, visuospatial records of thought) as a revealing window into each person's interpretation of a given graph. First, we distill principles for Measurement of Abstract Graph Interpretation (MAGI principles) to guide the collection of valid interpretation data from viewers who may vary in expertise. Hope you enjoy this post, and let me know if you have improvements or questions.How do viewers interpret graphs that abstract away from individual-level data to present only summaries of data such as means, intervals, distribution shapes, or effect sizes? Here, focusing on the mean bar graph as a prototypical example of such an abstracted presentation, we contribute three advances to the study of graph interpretation. Note that increasing the “cap.scaling” decreases the cap width, and all arguments that don’t have a default need to be specifically defined! Finally, observant R users might notice that at the error bars are plotted on top of the points! This is an easy fix by re-plotting the points after calling Plot_ErrorBars() using the points() function. Xcolor = "red", ycolor = "blue", lwidth = 2, Plot_ErrorBars(x1, y1, x.err=x.se, y.err=y.se, xbar = T, ybar = T, Now I’m going to change some of the default parameters and plot both x and y error bars: Plot_ErrorBars(x1, y1, y.err=y.se, ybar = T) First I’ll just use the default arguments, and only plot error bars for the y values: I’ll also demonstrate how changing the “cap.scaling” argument changes the cap widths. Now we will use Plot_ErrorBars() with some fake data. Segments(x0 = x + xcap.width, y0 = y - y.err,

Segments(x0 = x + xcap.width, y0 = y + y.err, Segments(x0 = x - x.err, y0 = y + ycap.width, Segments(x0 = x + x.err, y0 = y + ycap.width, Xcap.width <- (par("usr") - par("usr"))/cap.scaling Ycap.width <- (par("usr") - par("usr"))/cap.scaling Ybar = F, cap.scaling = 50, xcolor = "black", Plot_ErrorBars<-function(x, y, x.err, y.err, xbar = F, # error bars for x-axis data, y-axis data, or both. # cap.scaling: scaling factor for size of error bar caps. # ybar: Whether error bars for y-axis values should be plotted (Default is F) # xbar: Whether error bars for x-axis values should be plotted (Default is F) # Plotting function to plot y- or x-axis error bars I think there are ways to get around this, but that is for another post 🙂 Lastly and most importantly, for Plot_ErrorBars() to work correctly, each argument that doesn’t have a default value MUST be called either by name or listed in the EXACT order as in the function definition. 50 seems to make a nice sized error bar cap so I set that as the default, but you can use whatever you think is best. You can also see how I calculate the width of the error bar caps: I take the difference between the largest and smallest value on the relevant axis and divide by the “cap.scaling” argument. xcolor = "black", mean that if no xcolor is specifically specified when the function is called, it will default to “black”). Note the default values for arguments in the function definition (ie. I’ve added a couple arguments to make the bars “pretty”, but it’s pretty easy to add additional arguments. Here goes:įirst we will start by creating the function. If anyone has any suggestions, let me know. Here I’ll show you how you can scale the size of the error bars (by size I referring to the cap width of the bars relative to the size of the axis…).I’ve implemented it as a function so that you can reuse it (and improve it!).

When you include them in a graph, they should be easy to read, but not overwhelm the graph. I’ve had a few blog posts in mind for a while now, so I decided to post one so I don’t get too backlogged.Ī common feature of scientific figures is the addition of error bars to data points, typically representing 2-standard deviations (SD), 2-standard errors (SE), etc. I’ve just been really busy (aren’t we all?).

So, it’s been a while since I last posted to this blog, but I haven’t forgotten about it.
