[R-sig-teaching] I need your thoughts on teaching with R

Derek Ogle DOgle at northland.edu
Thu Mar 12 03:52:10 CET 2009


Andrew,

I teach a intro statistics course to "science" students and some "general education" students and a "biometry" course to "natural resources" and a handful of other students at Northland College.  I have been using R in both of these statistics course, and in my fisheries science course, for four or five years now.  Below are my answers to your questions.  I would be happy to expand on these if you needed me to (though now coming back to re-read I see that I have typed quite a bit).


> 1) What are the instructional decisions that a person needs to make if they are going to be teaching statistics using R?

In general, I don't really think that these decisions are unique to R.  No matter the software I believe that an instructor, especially of an introductory class, has to make a decision of whether learning the software is one of the outcomes of the course or not.  When I taught with other software (Minitab) I chose not to have learning the software as an outcome.  However, when I began using R I decided that at least some understanding of the software should be an outcome because I felt that knowing R was adding value to the student.  I believe that this added value was especially important in my upper-level courses so it became important to me to make sure that students in the intro class were gaining some knowledge of the software (R).

Once an instructor chooses to use R, I believe they must decide whether to use one of the GUIs, whether to use an external editor, which "graphics system" (base, ggplot2, lattice) to use, or whether to use package-specific or base functions.


> 2) What decisions have you yourself made and what were your reasons?

Of the latter items mentioned above I chose NOT to use a GUI.  I am familiar with RCMDR, for example, but, personally, I think the power of R rests in the command line.  I do use TINN-R as an external editor because I like the ability for students to save their commands and recycle them for future problems.  I have not seen any "cost" to the student of using TINN-R (it is simple to learn).  I chose to use base graphics because of the simplicity (in my mind) of their functions (for doing the basic graphics needed in most intro classes).

I have also written a package of R functions that streamlines some of the base R functions.  For example, I have written a Subset() function that combines the base subset() and drop.levels() so that I don't have to explain to students the subtleties of why subset() does not drop the level from the list of possible levels for a factor variable after subsetting.  I have also written a function that can be used to provide a graphical display of probability calculations on a suite of probability distributions (motivated by a post by Dr. Bates on this list last year).  I did not want to create a large number of special purpose functions so I attempted to judiciously choose functions that simplified complexities or subtleties that I did not want students to be concerned with or that provided specific pedagogical advantages.  <BTW, my package is surely not up to the standards of other package developers but if anyone is interested it is available at www.rforge.net/NCStats.  A newer version using namespace will be up there when my semester is over in April.>  I also use some of the functions in the TeachingDemos package.

Finally, I made the conscious decision of not using the phrases "R programming" or "R coding."  It is my experience that many students do not consider themselves capable of "computer programming."  I explain that the functions are simply replacements for menu'd commands but that they can be saved and reproduced.  At most, I refer to "R scripts" but never "R programs."


> 3) How do you teach with R? Do you have sessions on R and other sessions where content is taught? Is the computing fully integrated with the content? Or some combinationn?

At Northland, I teach two 2-hour sessions a week for the intro class.  Generally, I use some portion of this time for a traditional lecture, some portion to teach "doing statistics with R", and then some time for the students to work independently with R and ask me questions.  The traditional lecture and the "doing statistics with R" sections follow each other closely so I would consider them to be "integrated."  In the "doing statistics with R" section I have found it better to provide students with a handout (easily accomplished by the instructor with Sweave()) rather than demonstrating with the computer or letting them type commands into the computer.  The two main advantages to this are that it is easier to keep students in roughly the same spot (if they are typing things in themselves then invariably someone forgot a comma, or misspelled, etc, and you spend all of your time troubleshooting individual students while others sit there or start surfing the net) and it lets the students see a correct set of commands on which they can take detailed notes (if they are typing in commands themselves they are just typing and not thinking and not taking notes that they can return to).

In the upper-level course, I fully integrate R into the notes and lecture.

You can seen what I do, if interested, because all of my class materials ("book", handouts, lecture slides) are available at www.ncfaculty.net/dogle/ and then follow the intro stats, biometry, or fisheries science "buttons."


> 4) If you have the heterogeneous group of students (some going on to program in R, others just trying to get through, etc.) how do we deal with this? Do we need to have different types of assignments and materials for the different students?
Again, I don't see this as a specific issue with using R -- i.e., even if we did all calculations by hand there would be heterogeneity amongst those that will continue with other statistics courses and those "just trying to get through."


> 5) A few more comments.
When I first started teaching with R I was just learning the program myself.  I was terrible at teaching with it (and the students hated it) but I believed that it was the correct software to use.  Now, five years later, I am a much better teacher of statistics and R and, most of my students either "enjoy" R (I have seen students become more accepting of typing in a command line rather than a GUI -- I believe that this is due to the amount of texting and chatting that they do relative to students from just a few years ago) or are, at least, accepting of the idea of "R".  I even more firmly believe that this is the proper software for students to learn.  Be firm in your commitment to R if you choose to teach with it but also be patient with yourself and your students during the first few years.

I do spend some time trying to teach students the "lexicon of R" as this makes communication about specific functions easier.  For example, my students will know about constructor and extractor functions, named and positional arguments, objects, assignment operators, vectors, data.frames, etc.  This has been a "cost" of using R in the sense that it does take time and, thus, "something else" had to go from my curriculum.

I also think that R is especially beneficial for my biometry course which focuses on regression (simple, multiple, and indicator variable), anova (one- and two-way), and logistic regression because the vast majority of these topics use a common set of functions -- lm(), anova(), summary(), confint(), etc.  In addition, I have added a few functions (in my NCStats function) to make fitted line plots, residual plots, and to compare all slopes.  Thus, students can learn a vast number of topics with very few commands in R.  The same can be said in the intro class for t.test() (one-sample, two-sample, matched-pairs) and chisq.test() (goodness-of-fit and general chi-square).  This efficiency is very convenient and powerful.

Finally, I have found R to be useful because students "like" free software, open-source concepts (at least at my environmental liberal arts college), and being on the "cutting edge."  The more students like in your class the more likely they are to learn.



Dr. Derek H. Ogle
Associate Professor of Mathematical Sciences and Natural Resources
Northland College
1411 Ellis Avenue
Box 112
Ashland, WI 
715.682.1300
www.ncfaculty.net/dogle/

Please consider the environment before printing this email.




More information about the R-sig-teaching mailing list