CMPE140 Introduction to Computing for Economics and Management
2017-2018 Fall
Aim:
CMPE 140 introduces basic concepts of computing with the R programming language. Course topics include an introduction into basic data structures (vector, matrix, lists, data frames, etc.), program control statements (conditional execution, for and while loops, etc.), data visualization and input/output.
Instructor: Emre Ugur (contact)
Teaching Assistants: Mert Tiftikci (CMPE), Serhat Cevikel (AD)
Office hours: Anytime. Drop a line before coming to my office (BM33)
Lecture notes and all communication is through Piazza. Please send email if you are not registered!
Timetable:
Lecture | Wednesday 13:00-15:00 | New Hall Building, Room NH405
|
Problem Session | Wednesday 15:00-16:00 | New Hall Building, Room NH405
|
Lab for CMPE104.1 | Friday 13:00-15:00 | CMPE Building, Room B4
|
Lab for CMPE104.2 | Friday 15:00-17:00 | CMPE Building, Room B4
|
Schedule:
Time | Chapter | Topics |
20.09.2017 |
Introduction
|
- Course objectives and organization,
- R Intro,
- R Download and Installation,
- Simple calculations,
- R help and documentation,
- R Programming Environment,
|
|
27.09.2017 |
Vectors
|
- Variable name conventions
- Creating data vectors
- Data vector indexing
- Data vector filtering
- Data vector sorting
- Data vector operations
- Creating regular sequences
- Creating repeated values
|
|
04.10.2017 |
Matrices
|
- Matrix creation
- Matrix modification
- Matrix operations
- Matrix indexing
- Matrix filtering
- Matrix function apply()
- Programming own functions
- Higher-dimensional arrays
|
|
11.10.2017 |
Lists
|
- Shortcomings of vectors and matrices
- Creating lists
- List indexing
- Adding/deleting list elements
- Concatenate lists
- Vectors as list components
- Example: word list
- Accessing list components/values
- Example: sort word list alphabetically
- Applying functions to lists
- Example: sort word list by word frequency
|
|
18.10.2017 |
Data frames
|
- Shortcomings of vectors and matrices
- Creating data frames
- Accessing data frames
- Data frame indexing
- Data frame modifications
|
|
20.10.2017 | Midterm! | |
25.10.2017 |
Loops
|
- Data import from file
- Data frame summary
- Scatter plot
- The for-loop
- Print variable when iterating
- Compute length/norm of a vector
|
|
01.11.2017 |
Loops continued
|
- Square elements of a vector
- Function findwords
- Read data from file
- if-else statement
- Plotting word frequencies from Wikipedia articles
|
|
08.11.2017 |
Loops continued
|
- Nested loops
- While loop
- Print vector elements when looping
- Compute length/norm of a vector
- While vs. for loop
- Break statement
- Quiz with the while loop
- Random numbers with the while loop
- Repeat loop
- Next statement
|
|
15.11.2017 |
Graphics |
- Scatter plot
- Barplot
- Scatter plots of data frames
- Histograms
- Figure arrays
- Scatter plot vs. Histogram
|
|
22.11.2017 |
Graphics Continued
|
- Boxplots
- Stripcharts
- Pie charts
- Word frequency
- Caffeine consumption and marital status
- Sales data
|
|
29.11.2017 |
Input and Output
|
- Read data with scan
- Read from the keyboard
- Read into a matrix
- Reading text files
- Accessing files from the Internet
- The UCI Machine Learning Repository
- Iris flower data set
- Word frequencies of ebooks from Project Gutenberg
- Export graphics
- Writing to files
|
|
06.12.2017 |
Data analysis Wrap-up
|
- Data structures
- Conversion between data types
- Correlation and dependence
- Linear Regression
- Prediction
|
|
13.12.2017 |
Summary for final exam |
|
|
Grading:
- Lab session (quiz) : 30 %
- Midterm : 25%
- Final : 45%