“Mail merge” with RMarkdown

The term “mail merge” might not be familiar to those who have not worked in an office setting, but here is the Wikipedia definition:

Mail merge is a software operation describing the production of multiple (and potentially large numbers of) documents from a single template form and a structured data source. The letter may be sent out to many “recipients” with small changes, such as a change of address or a change in the greeting line.

Source: http://en.wikipedia.org/wiki/Mail_merge

The other day I was working on creating personalized handouts for a workshop. That is, each handout contained some standard text (including some R code) and some fields that were personalized for each participant (login information for our RStudio server). I wanted to do this in RMarkdown so that the R code on the handout could be formatted nicely. Googling “rmarkdown mail merge” didn’t yield much (that’s why I’m posting this), but I finally came across this tutorial which called the process “iterative reporting”.

Turns our this is a pretty straightforward task. Below is a very simple minimum working example. You can obviously make your markdown document a lot more complicated. I’m thinking holiday cards made in R…

All relevant files for this example can also be found here.

Input data: meeting_times.csv

This is a 20 x 2 csv file, an excerpt is shown below. I got the names from here.

name meeting_time
Peggy Kallas 9:00 AM
Ezra Zanders 9:15 AM
Hope Mogan 9:30 AM
Nathanael Scully 9:45 AM
Mayra Cowley 10:00 AM
Ethelene Oglesbee 10:15 AM

R script: mail_merge_script.R

## Packages

## Data
personalized_info <- read.csv(file = "meeting_times.csv")

## Loop
for (i in 1:nrow(personalized_info)){
 rmarkdown::render(input = "mail_merge_handout.Rmd",
 output_format = "pdf_document",
 output_file = paste("handout_", i, ".pdf", sep=''),
 output_dir = "handouts/")

RMarkdown: mail_merge_handout.Rmd

output: pdf_document

```{r echo=FALSE}
personalized_info <- read.csv("meeting_times.csv", stringsAsFactors = FALSE)
name <- personalized_info$name[i]
time <- personalized_info$meeting_time[i]

Dear `r name`,

Your meeting time is `r time`.

See you then!

Save the Rmd file and the R script in the same folder (or specify the path to the Rmd file accordingly in the R script), and then run the R script. This will call the Rmd file within the loop and output 20 PDF files to the handouts directory. Each of these files look something like this


with the name and date field being different in each one.

If you prefer HTML or Word output, you can specify this in the output_format argument in the R script.

Reproducibility breakout session at USCOTS

Somehow almost an entire academic year went by without a blog post, I must have been busy… It’s time to get back in the saddle! (I’m using the classical definition of this idiom here, “doing something you stopped doing for a period of time”, not the urban dictionary definition, “when you are back to doing what you do best”, as I really don’t think writing blog posts are what I do best…)

One of the exciting things I took part in during the year was the NSF supported Reproducible Science Hackathon held at NESCent in Durham back in December.

I wrote here a while back about making reproducibility a central focus of students’ first introduction to data analysis, which is an ongoing effort in my intro stats course. The hackathon was a great opportunity to think about promoting reproducibility to a much wider audience than intro stat students — wider with respect to statistical background, computational skills, and discipline. The goal of the hackathon was to develop a two day workshop for reproducible research, or more specifically, reproducible data analysis and computation. Materials from the hackathon can be found here and are all CC0 licensed.

If this happened in December, why am I talking about this now? I was at USCOTS these last few days, and lead a breakout session with Nick Horton on reproducibility, building on some of the materials we developed at the hackathon and framing them for a stat ed audience. The main goals of the session were

  1. to introduce statistics educators to RMarkdown via hands on exercises and promote it as a tool for reproducible data analysis and
  2. to demonstrate that with the right exercises and right amount of scaffolding it is possible (and in fact easier!) to teach R through the use of RMarkdown, and hence train new researchers whose only data analysis workflow is a reproducible one.

In the talk I also discussed briefly further tips for documentation and organization as well as for getting started with version control tools like GitHub. Slides from my talk can be found here and all source code for the talk is here.

There was lots of discussion at USCOTS this year about incorporating more analysis of messy and complex data and more research into the undergraduate statistics curriculum. I hope that there will be an effort to not just do “more” with data in the classroom, but also do “better” with it, especially given that tools that easily lend themselves to best practices in reproducible data analysis (RMarkdown being one such example) are now more accessible than ever.

Notes and thoughts from JSM 2014: Student projects utilizing student-generated data

Another August, another JSM… This time we’re in Boston, in yet another huge and cold conference center. Even on the first (half) day the conference schedule was packed, and I found myself running between sessions to make the most of it all. This post is on the first session I caught, The statistical classroom: student projects utilizing student-generated data, where I listened to the first three talks before heading off to catch the tail end of another session (I’ll talk about that in another post).

Samuel Wilcock (Messiah College) talked about how while IRBs are not required for data collected by students for class projects, the discussion of ethics of data collection is still necessary. While IRBs are cumbersome, Wilcock suggests that as statistic teachers we ought to be aware of the process of real research and educating our students about the process. Next year he plans to have all of his students go through the IRB process and training, regardless of whether they choose to collect their own data or use existing data (mostly off the web). Wilcock mentioned that, over the years, he moved on from thinking that the IRB process is scary to thinking that it’s an important part of being a stats educator. I like this idea of discussing in the introductory statistics course issues surrounding data ethics and IRB (in a little more depth than I do now), though I’m not sure about requiring all 120 students in my intro course to go through the IRB process just yet. I hope to hear an update on this experiment next year from to see how it went.

Next, Shannon McClintock (Emory University) talked about a project inspired by being involved with the honor council of her university, when she realized that while the council keeps impeccable records of reported cases, they don’t have any information on cases that are not reported. So the idea of collecting student data on academic misconduct was born. A survey was designed, with input from the honor council, and Shannon’s students in her large (n > 200) introductory statistics course took the survey early on in the semester. The survey contains 46 questions which are used to generate 132 variables, providing ample opportunity for data cleaning, new variable creation (for example thinking about how to code “any” academic misconduct based on various questions that ask about whether a student has committed one type of misconduct or another), as well as thinking about discrepant responses. These are all important aspects of working with real data that students who are only exposed to clean textbook data may not get a chance practice. It’s my experience that students love working with data relevant to them (or, even better, about them), and data on personal or confidential information, so this dataset seem to hit both of those notes.

Using data from the survey, students were asked to analyze two academic outcomes: whether or not student has committed any form of academic misconduct and an outcome of own choosing, and presented their findings in n optional (some form of extra credit) research paper. One example that Shannon gave for the latter task was defining a “serious offender”: is it a student who commits a one time bad offense or a student who habitually commits (maybe nor so serious) misconduct? I especially like tasks like this where students first need to come up with their own question (informed by the data) and then use the same data to analyze it. As part of traditional hypothesis testing we always tell students that the hypotheses should not be driven by the data, but reminding them that research questions can indeed be driven by data is important.

As a parting comment Shannon mentioned that the administration at her school was concerned that students finding out about high percentages of academic offense (survey showed that about 60% of students committed a “major” academic offense) might make students think that it’s ok, or maybe even necessary, to commit academic misconduct to be more successful.

For those considering the feasibility of implementing a project like this, students reported spending on average 20 hours on the project over the course of a semester. This reminded me that I should really start collecting data on how much time my students spend on the two projects they work on in my course — it’s pretty useful information to share with future students as well as with colleagues.

The last talk I caught in this session was by Mary Gray and Emmanuel Addo (American University) on a project where students conducted an exit poll asking voters whether they encountered difficulty in voting, due to voter ID restrictions or for other reasons. They’re looking for expanding this project to states beyond Virginia, so if you’re interested in running a similar project at your school you can contact Emmanuel at addo@american.edu. They’re especially looking for participation from states with particularly strict voter ID laws, like Ohio. While it looks like lots of work (though the presenters assured us that it’s not), projects like these that can remind students that data and statistics can be powerful activism tools.

Data Analysis and Statistical Inference starts tomorrow on Coursera

It has been (and still is) lots of work putting this course together, but I’m incredibly excited about the opportunity to teach (and learn from) the masses! Course starts tomorrow (Feb 17, 2014) at noon EST.


A huge thanks also goes out to my student collaborators who helped develop, review, and revise much of the course materials (and who will be taking the role of Community TAs on the course discussion forums) and to Duke’s Center for Instructional Technology who pretty much runs the show.

This course is also part of the Reasoning, Data Analysis and Writing Specialization, along with Think Again: How to Reason and Argue and English Composition 1: Achieving Expertise. This interdisciplinary specialization is designed to strengthen students’ ability to engage with others’ ideas and communicate productively with them by analyzing their arguments, identifying the inferences they are drawing, and understanding the reasons that inform their beliefs. After taking all three courses, students complete an in-depth capstone project where they choose a controversial topic and write an article-length essay in which they use their analysis of the data to argue for their own position about that topic.

Let’s get this party started!

Conditional probabilities and kitties

I was at the vet yesterday, and just like with any doctor’s visit experience, there was a bit of waiting around — time for re-reading all the posters in the room.


And this is what caught my eye on the information sheet about feline heartworm (I’ll spare you the images):


The question asks: “My cat is indoor only. Is it still at risk?”

The way I read it, this question is asking about the risk of an indoor only cat being heartworm positive. To answer this question we would want to know P(heartworm positive | indoor only).

However the answer says: “A recent study found that 27% of heartworm positive cats were identified as exclusively indoor by their owners”, which is P(indoor only | heartworm positive) = 0.27.

Sure, this gives us some information, but it doesn’t actually answer the original question. The original question is asking about the reverse of this conditional probability.

When we talk about Bayes’ theorem in my class and work through examples about sensitivity and specificity of medical tests, I always tell my students that doctors are actually pretty bad at these, looks like I’ll need to add vets to my list too!

My first Shiny experience – CLT applet

When introducing the Central Limit Theorem for the first time in class, I used to use applets like the SOCR Sampling Distribution Applet or the OnlineStatBook Sampling Distribution Applet. If you are reading this post on Google Chrome, chances are those previous links did not work for you. If on another browser, they may have, but you may have also seen warnings like this one:


Last year when I tried using one of these applets in class and had students pull it up on their own computers as well, it was a chaos. Between warnings like this and no simple way for everyone in their various computers and operating systems to update Java, most students got frustrated. As a class we had to give up playing with the applet, and the students just watched me go through the demonstrations on the screen.

In an effort to make things a little easier this year, I searched to see if I could find something similar created using Shiny. This one, created by Tarik Gouhier, looked pretty promising. However it wasn’t exactly what I was looking for. For example, it’s pretty safe to assume that my students have never heard of the Cauchy distribution, and I didn’t want to present something that might confuse them further.

Thanks to the code being available on GitHub, I was able to re-write the applet to match the functionality of the previous CLT applets: http://rundel.dyndns.org:3838/CLT.


I’m sure I’ll make some edits to the applet after I class-test it today. Among planned improvements are:

  • an intermediary step between the top (population distribution) and the bottom (sampling distribution) plots: the sample distribution.
  • sliders for input parameters (like mean and standard deviation) for the population distribution.

None of this is revolutionary, but it’s great to be able to build on someone else’s work so quickly. Plus, since all of the code is in R, which the students are learning anyway, those who are particularly motivated can dive deeper and can see the connection between the demonstration and what they’re doing in lab.

If you use such demonstrations in your class and have suggestions for improvements, leave a comment below. If you’d like to customize the applet for your use, the code is linked on the applet page, and I’ll be transitioning it to GitHub as I work on creating a few more of such applets.

(I should also thank Colin Rundel who helped with the implementation and is temporarily hosting the applet on his server until I get my Shiny Server set up — I filled out the registration form last night but I’m not yet sure what the next step is supposed to be.)

JSM 2013 – Days 4 and 4.5

I started off my Wednesday with the “The New Face of Statistics Education (#480)” session. Erin Blackenship from UNL talked about their second course in statistics, a math/stat course where students don’t just learn how to calculate sufficient statistics and unbiased estimators but also learn what the values they’re calculating mean in context of the data. The goal of the course is to bring together the kind of reasoning emphasized in intro stat courses with the mathematical rigor of a traditional math/stat course. Blackenship mentioned that almost 90% of the students taking the class are actuarial science students who need to pass the P exam (the first actuarial exam) therefore the probability theory must be a major component of the course. However UNL has been bridging the gap between these demands and the GAISE guidelines by introducing technology to the course (simulating empirical sampling distributions, checking distributional assumptions, numerical approximation) as well as using writing assessments to improve and evaluate student learning. For example, students are asked to explain in their own words the difference between a sufficient statistic and minimal sufficient statistic, and answers that put things in context instead of regurgitating differences are graded highly. This approach not only allows students who struggle with math to demonstrate understanding, but it also reveals shallow understanding of students who might be testing well in terms of the math by simply going through the mechanics.

In my intro stat class I used to ask similar questions on exams, but have been doing so less and less lately in the interest of time spent on grading (they can be tedious to grade). However lately I’ve been trying to incorporate more activities into the class, and I’m thinking such exercises might be quite appropriate as class activities where students work in teams to perfect their answers and perhaps even teams then grading each others’ answers.

Anyway, back to the session… Another talk in the session given by Chris Malone from Winona State was about modernizing the undergraduate curriculum. Chris made the point that we need much more than just cosmetic changes as he believes the current undergraduate curriculum is disconnected from what graduates are doing when they get their first job. His claim was that the current curriculum is designed for the student who is going on to graduate school in statistics, but that that’s only about a fifth of the students in undergraduate majors. (As an aside, I would have guessed the ratio to be even lower.) He advocated for more computing in the undergrad curriculum, a common thread among many of the education talks at JSM this year, and described a few new programs at Winona and other universities on data science. Another common thread was this discussion of “data science” vs. “statistics”, but I’m not going to go there – at least not in this post. (If you’re interested in this discussion, this Simply Statistician post initiated a good conversation on the topic in the comments section.) I started making a list of Data Science programs I found while searching online but this post seems to have a pretty exhaustive list (original post dates back to 2012 but it seems to be updated regularly).

Other notes from the day:
R visreg package looks pretty cool, though perhaps not necessarily very useful for an intro stat course where we don’t cover interactions, non-linear regression, etc.
– There is another DataFest like competition going on in the Midwest: MUDAC – maybe we should do a contributed session at JSM next year where organizers share experiences with each other and the audience to solicit more interest in their events or inspire others.

On Thursday I only attended one session: “Teaching the Fundamentals (#699)” (the very last session, mine). You can find my slides for my talk on using R Markdown to teach data analysis in R as well as to instill the importance of reproducible research early on here.

One of the other speakers in my session was Robert Jernigan, who I recognize from this video. He talked about how students confuse “diversity” and “variability” and hence have a difficult time understanding why a dataset like [60,60,60,10,10,10] has a higher standard deviation than a dataset like [10,20,30,40,50,60]. He also mentioned his blog statpics.com, which seems to have some interesting examples of images like the ones in his video on distributions.

John Walker from Cal Poly San Luis Obispo discussed his experiment on how well students can recognize normal and non-normal distributions using normal probability plots — a standard approach for checking conditions for many statistical methods. He showed that faculty do significantly better than students, which I suppose means that you do get better at this with more exposure. However the results aren’t final, and he is considering some changes to his design. I’m eager to see the final results of his experiment, especially if they come with some evidence/suggestions for what the best method to teach this skill is.

JSM 2013 – Day 3

Tuesday was a slightly shorter day for me in terms of talks as I had a couple meetings to attend. The first talk I attended was my colleague Kari Lock Morgan’s talk titled “Teaching PhD Students How to Teach” (in the “Teaching Outside the Box, Ever So Slightly (# 358)” session). The talk was about a class on teaching that she took as a grad student and now teaches at Duke. She actually started off by saying that she thought the title of her talk was misleading, as the talk wasn’t about teaching PhD students a particular way to teach, but instead about getting these students to think about teaching, which, especially in research universities, can take a backseat to research. This course features role playing office hours, video-taped teaching sessions which students then watch and critique themselves and each other, as well as writing and revising teaching statements. If you’re interested in creating a similar course, you can find her materials on her course webpage.

In the afternoon I attended part of the “The ‘Third’ Course in Applied Statistics for Undergraduates  (#414)” session. The first talk titled “Statistics Without the Normal Distribution” by Monnie McGee started off by listing three “lies” and corresponding “truths”:

  • Lie: T-intervals are appropriate for n>30.
  • Truth: It’s time to retire the n>30 rule. (She referenced this paper by Tim Hesterberg.)
  • Lie: Use the t-distribution for small data sets.
  • Truth: Permutation distributions give exact p-values for small data sets.
  • Lie: If a linear regression doesn’t work, try a transformation.
  • Truth: The world is nonlinear and multivariate and dynamic. (I don’t think “try a transformation” should be considered a lie, perhaps a “lie” would be “If a linear regression doesn’t work, a transformation will always work.”)

McGee talked about how they’ve reorganized the curriculum at Southern Methodist University so that statistics students take a class on non-parametrics before their sampling course. This class covers rank and EDF-based procedures such as the Wilcoxon, signed rank, and Mann-Whitney tests as well as resampling methods which are especially useful for estimation of numerous features of a distribution, like the median, independently of the population distribution. The course uses the text by Higgins (Introduction to Modern Nonparametric Statistics) as well as a series of supplements (which I didn’t take notes on, but I’m sure she’d be happy to share the list with you if you’re interested). However she also mentioned that she is looking for an alternative textbook for the course. Pedagogically, the class uses just in time teaching methods — students read the material and complete warm up exercises before class each week, and class time is tailored to concepts that students appear to be struggling with based on their performance on the warm up exercises.

The second talk in the session titled “Nonlinear, Non-Normal, Non-Independent?” was given by Alison Gibbs. Gibbs also described a course that focuses on models for situations when classical regression assumptions aren’t met. She gave examples from a case study on HPV vaccinations that she uses in this class (I believe the data come from this paper). She emphasized the importance of introducing datasets that are interesting, controversial, authentic, and that lend themselves to asking compelling questions. She also mentioned that she doesn’t use a textbook for this class, and finds this liberating. While I can see how not being tied to a textbook would be liberating, I can’t help but think some students might find it difficult to not have a reference — especially those who are struggling in the class. However I presume this issue can be addressed by providing the students with lecture notes and other resources in a very organized fashion. I have to admit that I was hoping that I would hear Gibbs talk about her MOOC at this conference as I am gearing up to teach a similar MOOC next year. Perhaps I should track her down and pick her brain a bit…

At this point I ducked out of this session to see my husband Colin Rundel’s talk in the “Statistical Computing: Software and Graphics (#430)” session. His talk was on a new R package that he is working on (RcppGP) to improve the performance of Gaussian process models using GPU computing. He started with a quote: “If the computing complexity is linear, you’re OK; if quadratic, pray; if cubic, give up.” Looks like he and other people working in this area are not willing to give up quite yet. If you’re interested in his code and slides, you can find them at his GitHub page.

The sessions on my agenda for tomorrow are:

JSM 2013 – Day 2

My Monday at JSM started with the “The Profession of Statistics and Its Impact on the Media (#102)” session. The first speaker in the session, Mark Hansen, was a professor of mine at UCLA, so it was nice to see a familiar face (or more like hear a familiar voice – the room was so jam packed that I couldn’t really “see” him) and catch up on what he has been working on at his new position at Columbia University as a Professor of Journalism and the Director of David and Helen Gurley Brown Institute for Media Innovation. The main theme of the talk was the interaction between journalists and statisticians — he discussed how journalism can provide much needed perspective, language, and practices necessary to describe the forces that data exert in our worlds, to help even statisticians gain fresh perspective on their practice. He pointed out a difference between how journalists and statisticians work with data: journalists work with data to tell a story in the context of a dataset, while statisticians tend to tell a story of the dataset. Hansen also discussed Columbia’s new two-year dual degree Master’s in journalism and computer science. The Brown Institute also awards seed funding to students for developing media technologies that could transform how news content is produced, delivered and consumed. I’ve listed a few of the projects that Hansen discussed below, and a detailed post on these grants can be found here.

  • Dispatch: a mobile application that provides secure, authenticated, anonymous instant publishing.
  • Personalized Television News: a project that seeks to develop and demonstrate a platform for personalized television news to replace the traditional one-broadcast-fits-all model.
  • CityBeat: a project that looks for newsworthy events in the patterns of real-time, geotagged social media feeds.
  • The Declassification Engine: An engine that uses machine learning to declassify documents.
  • Bushwig: Telling the story of a drag renaissance taking place in Bushwick, Brooklyn, that is enlisting and extending social media platforms for the “identity curation” that happens in the drag community. I had no idea that Facebook does not allow, or at least takes down when found out, two profiles for the same person, which, as you can imagine, can be an issue for people who live their lives in two identities.

Hansen also discussed a recent project where he collaborated with the NYTimes’ R&D lab, working on projects such as Project Cascade, which is a tool that constructs “a detailed picture of how information propagates through the social media space”, like Twitter.

The next talk in the session by Don Berry discussed fundamental issues in statistics that are difficult to convey to journalists, and hence the rest of the public, such as Simpson’s paradox, results that are “too good to be true” (e.g. dogs sniffing cancer), regression to the mean, multiple comparisons, etc. He also discussed at length prosecutor’s fallacy, within the context of the case of nurse Lucia de Berk who was convicted in was convicted in 2004 of a number of murders and attempted murders of patients in her care, but then was freed in 2010. I don’t discuss prosecutor’s fallacy in my introductory statistics class, but I’m thinking that I should… Berry recommended this NYTimes article on the topic, as well as this TED talk on prosecutor’s fallacy in general). Berry, who is often quoted in newspaper articles as an expert, also discussed what statisticians (and other scientists) should and should not do when interacting with journalists. Some of the key points were:

  • Simplify, short of lying
  • Be pithy
  • Avoid questions that you don’t want to answer – He mentioned that he avoids questions like “What are the economic implications?”
  • Use going off the record sparingly
  • Prefer email over telephone – so that you can edit your own words
  • Don’t diss anyone

The last one seems obvious, but see this  this Washington Post article on the 2009 breast cancer screening frequency controversy. In the article, a radiology professor from Harvard is quoted saying “Tens of thousands of lives are being saved by mammography screening, and these idiots want to do away with it”. Wow!

The next speaker was Howard Wainer (whose article titled “The Most Dangerous Equation: Ignorance of how sample size affects statistical variation has created havoc for nearly a millennium” is a good read, by the way). I am excited to take a peek at his recently published book Medical Illuminations at the Expo later today.

The last speaker in the session was Alan Schwarz, the Pulitzer-prize nominated reporter at the NYTimes who did an expose on current and retired football players suffering from post-concussion syndrome and early-onset dementia, more specifically Chronic Traumatic Encephalopathy. A journalist talking about using data and statistics to uncover a story was a nice complement to the earlier talks by statisticians talking about working with journalists.

In the afternoon I attended the “Toward Big Data in Teaching Statistics (#210)” session. Nicholas Chamandy from Google talked about how big data requires novel solutions to old problems and gave examples from some of the algorithms Google uses to solve problems in predictive modeling.

Randall Pruim’s talk focused on the efforts of the Computation and Visualization Consortium that has started working on identifying key skills that students need to work with big data and ways to teach them. It was quite eye opening to hear about a survey he conducted asking faculty members from science departments such as physics and chemistry what kind/size of data their students work with – turns out for many the answer is no data at all! He also gave an overview of efforts at Macalester, Smith, and Calvin Colleges for introducing big data skills into their curriculum. I will be looking into the syllabus for the class being taught at Macalester by Danny Kaplan, as I’m also currently brainstorming how best to teach core computational skills to our students.

Nick Horton also discussed his vision for accomplishing this, which is to start in the first course, to build on it in the second course, to provide more opportunities for students to apply their knowledge in practice (internships, collaborative research, teaching assistants), and to introduce new courses focused on data science into the curriculum. He also discussed exposing students to reproducible research using RStudio and R Markdown. I’ve previously written a blog post about this, and will be talking about it on Thursday at my own talk as well. It was nice to see a similar approach being used by others in the statistics education field. What especially resonated with me was Nick’s comment on how using R Markdown facilitates appropriate and correct statistical workflow for students.

The last talk of the day I attended was Nate Silver’s President’s Invited Address, along with just about everyone else attending JSM. The turnout was great, and his talk was highly enjoyable, as expected. Gregory Matthews (Stats in the Wild) already posted a list of his talking points, so instead of listing them here again, I’ll just link to that post. The Q&A was just as interesting as the talk itself, below are a few notes I jotted down:

  • Q: What can statisticians learn from journalists?
  • A: Clarity of expression – results are only useful when you can explain them.
  • Q: How can ASA and statisticians do more on advocacy?
  • A: Blog! Researchers should do their own communication.
  • Q: Any career advice for young statisticians?
  • A: Do something practical and applied first, theory is easier to learn as needed.
  • Q: Favorite journalist/writer?
  • A: Bill James
  • Q: Data scientist vs. statistician?
  • A: Call yourself whatever you want, just do good work. (One of the better answers I’ve heard on this topic. Though his earlier answer “data science is just a sexed up term for statistics” seemed to resonate well with some in the room and not so much with others.)
  • Q: What is the future of sports statistics?
  • A: More data being collected on soccer, so there is more to be done there. (This means that finally there may be sports statistics that I actually care about and can get excited by!)

After the talks I stopped by the UCLA mixer, it was nice to see some old faces. And I finished up the evening at the Duke dinner, with great company and lots of wine…

Now on to Day 3…

JSM 2013 – Day 1

Bonjour de Montréal!

I’m at JSM 2013, and thought it might be nice to give a brief summary of highlights of each day. Given the size of the event, any session that I attend means I’m missing at least ten others. So this is in no way an exhaustive overview of the day at the conference, more tidbits from my day here. I’ll make a public commitment to post daily throughout the conference, hoping that the guilt of not living up to my promise helps me not lose steam after a couple days.

The first session I attended today had a not so exciting title — “Various Topics in Statistics Education (#43)” — but turned out to be quite the opposite. The first three talks of the session were about the case of Diederik Stapel – a former professor of social psychology in the Netherlands who was suspended from Tilburg University for research fraud. Stapel published widely publicized studies, some of which included results that purport to show that a trash-filled environment tended to bring out racist tendencies in individuals or that eating meat made people selfish and less social. As the speakers at the session (Ruud Koning, Marijtje van Duijn, and Wendy Post from the University of Groningen, and Don van Ravenzwaaij from the University of New South Wales) put it today, the data and the results were “too good to be true”.

First, Koning gave an overview of the case – unfortunately I walked in a little late. If you’re not familiar with it, I would recommend this NYTimes article as well as this paper by Pieter Drenth.

Next, van Duijn discussed best practices for reviewers so that fraud can be caught early on. For example, some indicators of mistakes in Stapel’s papers were impossible means and effect sizes (compared to previous literature), impossible combinations of sample size and degrees of freedom, and incorrect p-values. These could, and should, have been caught by reviewers but this is easier said than done. van Dujin and van Ravenzwaaij suggest that journals should encourage sharing data and reproducibility (a view shared by many in the statistics community). However the responsibility of ensuring thorough reviews should also be shared by universities, science foundations, and policy makers. For example, an interesting suggestion was universities rewarding good peer reviews, as well as good data collection, archiving, and sharing.

The last talk in the series given by Post focused on what to do in education to prevent fraud. Two points that resonated with me were the need for teaching data management, as early as possible in the curriculum, and focusing on descriptive statistics before p-values. Post also advocates for putting emphasis on teaching philosophy of science.

Not only was this discussion very informative and interesting to listen to, it also provided me with a good case study to incorporate into my Statistical Consulting course which has a research ethics component. In the past year we’ve discussed the Potti case, so this will be a nice addition from a different field (and a different university!).

The other session that I attended today was the “Introductory Overview Lecture: Celebrating the History of Statistics (#47)” by Xiao-Li Meng, Alan Agresti, and Stephen Stigler. If you are interested in history of statistics departments, Agresti and Meng’s book Strength in Numbers: The Rising of Academic Statistics Departments in the US sounds like a promising read. The session wrapped up with Stigler’s history of statistics review, titled “How Statistics Saved the Human Race”. He was a delight to listen to as usual. I hope that in the future such sessions are recorded and posted online for all to see, as they should be of interest to a wide audience of statisticians and non-statisticians alike. I don’t think the ASA does this yet, but correct me if I’m wrong.

Three other sessions that I would like to have attended today were

  • “Teaching Ethics in Statistics and Biostatistics: What Works, What Doesn’t Work, and Lessons Learned (#55)”,
  • “The Interplay Between Consulting and Teaching (#68)”, and
  • “Teaching Online on a Budget (#75)”.

If you’ve been to any of these, and have notes to share, please comment below!

On a separate note, unrelated to JSM —

  • If you’re here in Montréal, and especially if you live in a city without good bagels (Durham, I love you, but you don’t deliver on this account), I strongly recommend a trip up to Fairmount Bagel. They’re open 24 hours, and the bagels are great, but the matzoh bread is to die for. Also, apparently in Quebec “everything” bagels are called “all dressed”.
  • It turns out that not everything is good with maple syrup. I strongly advise against trying the Lay’s Maple Moose chips. Trust me on this one.