I’ve provided R Exercises to work through basic data management, plotting and statistics, but there are many other good sources of information to learn these tasks in R. There is an R package called swirl (Statistics with Interactive R Learning) that walks you through interactive tutorials. If you are not familiar with R and with regression analysis and want more help, try working through the start of the swirl tutorial on Regression Models. This is helpful to understand both the concepts and the implementation in R. First, install the swirl package and load it: 1
#install.packages("swirl") # I have this commented out, because swirl is already on my computer
rm(list=ls()) #clean up the memory, as usual (otherwise you'll get a warning)
library("swirl")
##
## | Hi! Type swirl() when you are ready to begin.
Then install some specific ‘courses’ or tutorials. In this case, install the course on Regression Models:
install_from_swirl("Regression Models")
##
## | Course installed successfully!
And then launch the tutorial
swirl()
In the Console (bottom left panel of R Studio) you’ll see the following:
Welcome to swirl!
Please sign in. If you’ve been here before, use the same name as you did then. If you are new, call yourself something unique.
What shall I call you?
Give it a name to call you during the interactive tutorial, and it will then display:
Please choose a course, or type 0 to exit swirl.
1: Regression Models
2: Take me to the swirl course repository!
Selection:
Reply with 1 to start the regression tutorial and then just follow the instructions. For BIOE 440R/521 the first lesson is probably all you need (the others are also useful, but will require a lot more time). It uses one of the original data sets used in the development of regression models as an example, from Galton’s work on heritabily of height in people (and explains why this sort of analysis came to be called ‘regression’).
You can use cut-and-paste rather than typing when it tells you to type a command. Your choice