Publications by Nick Horton

Example 9.22: shading plots and inequalities

01.03.2012

A colleague teaching college algebra wrote in the R-sig-teaching list asking for assistance in plotting the solutions to the inequality x^2 – 3 > 0. This type of display is handy in providing a graphical solution to accompany an analytic one. RThe plotFun() function within the mosaic package comes in handy here.library(mosaic) plotFun( x^2 -3 ~...

2260 sym R (829 sym/4 pcs) 22 img

Example 9.28: creating datasets from tables

23.04.2012

RThere are often times when it is useful to create an individual level dataset from aggregated data (such as a table). While this can be done using the expand.table() function within the epitools package, it is also straightforward to do directly within R.Imagine that instead of the individual level data, we had only the 2×2 table for the assoc...

2465 sym R (2606 sym/5 pcs) 14 img

Example 9.29: the perils of for loops

30.04.2012

A recent exchange on the R-sig-teaching list featured a discussion of how best to teach new students R. The initial post included an exercise to write a function, that given a n, will draw n rows of a triangle made up of “*”, noting that for a beginner, this may require two for loops. For example, in pseudo-code:for i = 1 to n ...

3160 sym R (727 sym/4 pcs) 14 img

Example 9.30: addressing multiple comparisons

07.05.2012

We’ve been more sensitive to accounting for multiple comparisons recently, in part due to work that Nick and colleagues published on the topic. In this entry, we consider results from a randomized trial (Kypri et al., 2009) to reduce problem drinking in Australian university students. Seven outcomes were pre-specified: three designated as pri...

4072 sym R (1370 sym/4 pcs) 18 img

Example 9.37: (Mis)behavior of binomial confidence intervals

09.07.2012

While traditional statistics courses teach students to calculate intervals and test for binomial proportions using a normal or t approximation, this method does not always work well. Agresti and Coull (“Approximate is better than “exact’ for interval estimation of binomial proportions”. The American Statistician, 1998; 52:119-126) demons...

4473 sym Python (5067 sym/7 pcs) 18 img

Example 9.38: dynamite plots, revisited

16.07.2012

Dynamite plots are a somewhat pejorative term for a graphical display where the height of a bar indicates the mean, and the vertical line on top of it represents the standard deviation (or standard error). These displays are commonly found in many scientific disciplines, as a way of communicating group differences in means. Many find these displa...

2869 sym R (944 sym/2 pcs) 16 img

The Statistical Sleuth (second edition) in R

14.08.2012

For those of you who teach, or are interested in seeing an illustrated series of analyses, there is a new compendium of files to help describe how to fit models for the extended case studies in the Second Edition of the Statistical Sleuth: A Course in Methods of Data Analysis (2002), the excellent text by Fred Ramsey and Dan Schafer. If you are...

2247 sym 16 img

Example 2014.13: Statistics doesn’t have to be so hard! Resampling in R and SAS

17.11.2014

A recent post pointed us to a great talk that elegantly described how inferences from a trial could be analyzed with a purely resampling-based approach. The talk uses data from a paper that considered the association between beer consumption and mosquito attraction. We recommend the talk linked above for those thinking about creative ways to te...

5324 sym R (3239 sym/9 pcs) 18 img

2015.2: Did the New England Patriots experience a decrease in fumbles starting in 2007?

01.02.2015

Here’s a timely guest entry from Jeffrey Witmer (Oberlin College). As the “Deflate Gate” saga was unfolding, Warren Sharp analyzed “touches per fumble” for NFL teams before and after 2006, when a rule was changed so that teams playing on the road could provide their own footballs (http://www.sharpfootballanalysis.com/blog/)...

3975 sym R (2236 sym/10 pcs) 16 img

R and SAS in the curriculum: getting students to "think with data"

06.01.2016

We’re pleased to announce that a special issue of the American Statistician on “Statistics and the Undergraduate Curriculum” (November, 2015) is available at http://amstat.tandfonline.com/toc/utas20/69/4. Johanna Hardin (Pomona College) and Nick were the guest editors. There are a number of excellent and provocative papers that reinforc...

6552 sym 14 img