Course Materials Stat 370 Spring 2017
Contents
Day 1: January 17, 2017
We had introductions and we went over the syllabus. We talked about our goals and dreams and reasons for taking this course. We also talked about our experience with R and with programming in general.
Day 2: January 24, 2017
We talked about getting and installing R and RStudio. We discussed some of the panels within RStudio including the editor and the console. I showed you dynamic documents with R-Markdown. We wrote an R Script, and a dynamic document. We talked about Markov chains. I presented several project ideas concerning Markov chains, including applications to baseball, and neuroscience.
Day 3: January 27, 2017
I started by discussing a default project idea (click here). You are not required to follow this suggestion. Some students are already doing something else, and that is fine. Synergies with other projects, outside of this class, are encouraged.
After I discussed this project idea, we talked about calling and writing functions, and passing arguments to functions. We discussed required/positional arguments and optional/named arguments. The function getwd() was an example of one with no arguments. We talked about getting help...from Google and from the console with the ? and ?? commands. E.g. type "?getwd" for help on getwd() or "??topic" if you don't know the exact function name. We talked about operators such as + - * / and ^. We talked about variables, though we have more to discuss here. We talked about sampling from the vector c("HomeRun", "Single", "Double", "Triple", "Out").
Day 4: January 31, 2017
We did an introduction to Git and GitBash today. In GitBash we learned the commands "pwd", "ls", and "cd", plus three commands specific to git, "git init", "git add [file]", and "git commit -am "[message]". The brackets [...] and what is inside is replaced by what is indicated.
We did an lecture on Markov Chains. We presented an example of a traveler randomly selecting which city to visit next depending on what city they are currently in. We discussed transition probabilities and the transition probability matrix. A matrix was a two dimensional table of numbers. The entries have a row number and a column number. The rows indicate which city you travel from and the columns indicate which city you travel to. In Markov chains the nodes are called "states". In the traveler example, these are the cities. In baseball, the states include the information about which bases have runners and the number of outs.
Please read the first 5 pages of the "Modeling Baseball Using a Markov Chain" handout.
Day 5: February 3, 2017
Today we discussed variables and types of variables. The atomic types were logical, integer, numeric (double), character, complex and raw. We made vectors and lists and matrices, and arrays, and data frames with these atomic types. We also talked about variables whose values were functions. We then moved to work on Git. We created a GitHub account and forked Max Albert's Baseball_R repository that includes the code for our textbook. We created a new branch in our repository, made a change, then tried to push the branch to our forked repository. Pushing the branch didn't work.