Course meeting time: Thursday, 10:15 - 11:45, Missionsstrasse 64a, Computerraum 00.010
Syllabus (you’re looking at it) webpage: http://rpubs.com/ajluck/Syllabus2017
Instructor: Ashley Luckman, ashleyjames.luckman@unibas.ch
Office Hours: By appointment (or you can stop by my office at Missionsstrasse 62A and hope I am in)
Your homework for each class period is to actively read the readings for that week. A link to the textbook is below. All of the work you turn in will be done in class as WPAs (Weekly Programming Assignments).
New WPAs and readings will be uploaded weekly, so check back regularly.
| Week - Date | Topic | Texbook readings | Assignment (in class) |
|---|---|---|---|
| 1 - 23 Feb | Introduction | None | WPA #0 |
| 2 - 2 March | R basics, scalers and vectors | Chapters 1-4, 5, 6 | WPA #1, Answers- WPA #1 |
| 3 - 16 March | Indexing Vectors | Ch 7 | WPA # 2, Answers- WPA # 2 |
| 4 - 23 March | Matrices and Dataframes, Managing data | Ch 8 | WPA # 3, Answers- WPA # 3 |
| 5 - 30 March | Dataframe manipulation | Ch 9, Ch 10 | WPA # 4, Answers- WPA # 4 |
| 6 - 6 April | Plotting | Ch 11, Ch 12 | WPA # 5, Answers- WPA # 5 |
| 7 - 13 April | No Class | - | - |
| 8 - 20 April | 1 and 2 sample Hypothesis tests | Ch 13 | WPA # 6, Answers- WPA # 6 |
| 9 - 27 April | ANOVA with aov() and anova() |
Ch 14 | WPA # 7 Answers- WPA # 7 |
| 10 - 4 May | Linear regression with lm() |
Ch 15 | WPA # 8, Answers- WPA # 8, WPA Bonus, WPA Bonus- Answers |
| 11 - 11 May | Writing Functions and Loops | Ch 16, 17 | WPA # 9, Answers- WPA # 9 |
| 12 - 18 May | Final project work | - | Final Project |
| 13 - 25 May | Final project work | - | - |
| 14 - 01 June | Final project work | - | - |
| End - 10 June | Final Project Due!!! | - | - |
| Link | Description |
|---|---|
| Textbook (YaRrr by Nathanial Phillips) | For weekly readings. |
| R Reference Card | A handy R guide. |
Dr. Nathaniel Phillips (teaching the Wednesday class), has created some youtube videos on R that might be useful.
| Week | Videos |
|---|---|
| 1 - 23 Feb | None |
| 2- 2 March | Vid-A, Vid-B, Vid-C |
| 3 - 16 March | - |
| 4 - 23 March | - |
| 5 - 30 March | - |
| 6 - 6 April | - |
| 7 - 13 April | - |
| 8 - 20 April | - |
| 9 - 27 April | - |
| 10 - 4 May | - |
| 11 - 11 May | - |
| 12 - 18 May | - |
| 13 - 25 May | - |
| 14 - 01 June | - |
| End - 10 June | - |
R is one of the most popular statistical languages for both academic researchers and data analysts working in industry. The reason why is simple - R is free, easy to use and incredibly powerful. With R you can generate and manipulate data, conduct analyses, create plots and even write documents. The goal of this course is to introduce you to R so you can apply it to your current and future research. In this course, you will learn how to use R to conduct all steps of your data analysis, from loading data to performing analyses, to producing figures.
This course is for anyone who wants to learn R. I don’t care if you’re 10 or 100 or what your background is in programming, math, etc.. If you want to learn R and know how to use a computer, this course is for you. That said, the course is designed around the needs of a psychology student in a Bachelor’s, Masters, or PhD program who has taken at least an introductory course in statistics.
This is not a traditional course – this is a ‘flipped’ course. This means that you will be learning the basic material on your own time outside of class, by actively reading and watching videos, and then ‘learn-by-doing’ in class. For more information about the ‘flipping’ concept, check out https://en.wikipedia.org/wiki/Flipped_classroom.
To learn the basic material, you will read chapters from the e-book YaRrr! The Pirate’s Guide to R written by Dr. Nathaniel Phillips. A link to the book can be found above, and the schedule will be updated with the relevant chapters weekly.
If you are interested in additional, non-piratey materials, there are numerous books and websites that can help you discover new ways of utilizing R. Three recommended books are:
You can also find free R courses at www.coursera.com, www.datacamp.com, and other similar websites. As is the case with most problems, a quick Google search will likely provide good solutions.
During each class you will work on a series of programming tasks called a Weekly Programming Assignment (WPA). You can do this alone, but I encourage you to discuss and/or work with the people around you. The questions on WPAs will start easy to help remind you of the reading, but end hard in order to push your knowledge of the material. At the end of class, you will email your work on the WPA to me to receive credit.
The WPAs are designed to be challening. For that reason, I do not expect you to finish the entire WPA by the end of class. Work hard, ask questions, and complete as many of the problems as you can. The only way to fail your assignment is to not turn it in. You are not expected to continue working on WPAs outside of class. However, each WPA will have a checkpoint to help you know whether you are falling behind or not. If you reach the checkpoint by the end of class, then you are doing just fine. If you do not reach the checkpoint, I strongly encourage you to continue working on the assignment outside of class so that you do not fall behind.
While I encourage you to work on and discuss the WPAs with those around you, it is very important that each student’s work is his/her own. Do not turn in any assignments that you did not contribute to or do not fully understand.
While I will keep track of how often you submit your WPAs, I will not grade them. I will only give you individual feedback if your work looks especially poor, or especially good. Complete answers to WPAs will be posted shortly after each class. It is your responsibility to look over the answers and compare them to your work. Of course, if you have specific questions about the assignment, please email me or come to my office and I will be very happy to help you.
At the end of the course you will complete a final analysis project. In this project, you will produce a report containing several key analyses from a dataset of your choosing. If you have a specific dataset you would like to analyze (such as from your thesis), you are welcome to use it. If not, I will assign one to you. I will give you more details about the project later in the course.
This is a pass / fail course. Passing the course is not difficult. If you work hard, ask lots of questions, turn in your WPAs and complete the final analysis project, you’ll pass the class. If you never ask questions, habitually fail to turn in your WPAs and turn in a poor quality final project, you may fail the course.
Attendance at class will be considered when deciding your grade. Therefore, if you can’t attendance a class, there are certain actions you neeed to take. These depend upon whether you know in advance you will be attending or not.
If something unexpected happens (e.g. sickness, family emergency, car/train breakdowns etc.) and you have to miss class for a week this is ok. In this situation it would be good if you can let me know after class that you missed it. It would also be beneficial for you to catch up on the work in your own time, so that you don’t fall behind. If you miss several classes, then we might need to talk about ways to make sure you don’t fall behind.
If you know in advance that you won’t be attending a class then the situation is different. In this case I expect you to let me know that you will be missing class, and to submit your completed WPA script by the end of the class for that week. You do not need to provide a reason for your absence in this case. For instance, if you were planning to miss class on the 23/03/2017, where we complete WPA 3, then I would expect you to email me a completed R script for WPA 3 by 11.45 am on Thursday 23/03/2017 (i.e. the end of the class). In general the link to each WPA will go online the weekend preceding that class, so you will have approximately 5 days to complete it.
Unlike in class, where I expect you to only complete as many exercises as the time allows, if you aren’t attending you need to complete all exercises for the week. If you fail to submit the completed WPA by the deadline twice, without an appropriate reason, then you will fail the course. If you are having trouble with the WPA for the week you can, off course, email me with questions or arrange a time to meet.
Learning R will be challenging, but ultimately rewarding. However it will be a lot easier if you ask questions. Here are the best ways to ask.
Use the help function
If you are unsure how a function works or what its doing, type ?functionname into the console (functionname should be the name of the function e.g. ?mean). Every function has documentation, and this command will bring it up. If you don’t know the exact function name, you can also type ??thingIamlooking (.e.g. ??mean) to perform a search for related documentation.
Google Everything
If you have a problem (particularly outside class) Google it. Almost every question you have, someone else has asked at some point. This applies particularly to R. There are a lot of good forums you might end up on, like stackoverflow.com, or stats.stackexchange.com, where people provide detailed answers. You also might find documentation and functions you couldn’t find using the internal help, or materials from other courses. I Google R and stats related questions daily and am constantly finding innovative answers and new functions. Just keep in mind that there is no point copying someone else’s code if you don’t understand how it works and how to adapt it to your circumstances.
Work together
If you are stuck, ask people around you for help, or if you see someone struggling, help them out. Ideally I want everyone constantly talking and working together in class. Learning any type of programming is a lot easier when you have people to talk to and share ideas and problems with.
Ask me questions
Thats why I’m here. If you don’t know what you are doing, why something doesn’t work (or does work), or what the person next to you is talking about, call me over. If you do know what you are doing, and why it works, but want to make it work better, also call me over. There is nothing worse for me than a class where no one asks me any questions. Also don’t be afraid to email me with questions or to arrange times to meet outside class.