Programming in R for Psychological Research: An Introduction
Syllabus, Master's level, 2PS114
- Code
- 2PS114
- Education cycle
- Second cycle
- Main field(s) of study and in-depth level
- Psychology A1N
- Grading system
- Fail (F), Sufficient (E), Satisfactory (D), Good (C), Very good (B), Excellent (A)
- Finalised by
- The Department Board, 28 February 2025
- Responsible department
- Department of Psychology
Entry requirements
A Bachelor's degree, equivalent to a Swedish Kandidatexamen, from an internationally recognised university. Also required is 90 credits in psychology with at least 7.5 credits in methods and statistics. Proficiency in English equivalent to the Swedish upper secondary course English 6.
Learning outcomes
- Demonstrate an understanding of the principles of computer programming and the core elements that apply to different programming languages.
- Be able to develop, implement, and test code for data analysis, with a focus on the use of R programming language for psychological research.
Content
This is an introductory programming course aimed at students without or with limited prior knowledge of programming. The course teaches general principles of programming which apply to different programming languages and may be flexibly adapted to more specific use in scientific analysis. Students will gain specific programming skills through the use of the R language in the applied context of psychological research.
The main topics for this course include:
- Program design: abstraction, sequencing, and algorithms.
- IDEs and coding environments: Rstudio.
- Variables, matrices, and operators.
- Data types and structures.
- Basic syntax, objects, and formulas.
- Flow control: conditional statements and loops.
- Loading and saving data.
- Functional programming: functions, arguments, and parameters.
- Data visualization.
- Good practices and efficient coding.
- Debugging.
Instruction
Teaching for this course will integrate lectures with interactive workshops for the implementation of coding assignments.
Assessment
The student's knowledge is assessed through active participation during workshops, oral presentations and homework assignments (writing and coding). The final examination will be in the form of a homework assignment that consists in creating and optimizing a code for data analysis based on an example project selected by the student, as well as an oral examination of this homework assignment.