Worksheet Week 3
Self-Assessment Questions7
- Explain the difference between \(\hat{y}_i\) and \(y_i\).
- Give an example for a scenario in which you could use regression analysis.
- Why is there an error term in regression?
- How does an error term differ from a residual?
- Consider the vector of error terms \(\epsilon\) (an n \(\times\) 1 matrix). How do you write \(\sum \epsilon^2\) in matrix notation?
Please stop here and don’t go beyond this point until we have compared notes on your answers.
Regression – Theory
- You are given the scatter plot in Figure 2.7 (taken from Gujarati & Porter (2009)) along with the regression line. What general conclusion do you draw from this diagram? Is the regression line sketched in the diagram a population regression line or a sample regression line?
Calculations with Matrices
As indicated on Moodle, we will start working with matrices next week. To familiarise yourself with these and to get a better overview how to work with them, please work through the following exercises. Feel free to consult the “Introduction to Matrices” Section for this.
First, answer these questions:
- What is a matrix?
- What does transposition do?
- What is the purpose of an identity matrix?
Now, consider the following three matrices A, B, and C: \[\begin{equation*} A = \begin{bmatrix} 9 & 4 & 11 \\ 6 & 8 & 3 \\ 14 & 7 & 9 \\ \end{bmatrix} \hspace{1cm} B = \begin{bmatrix} 13 & 8 & 12 & 2 \\ 1 & 5 & 15 & 3 \\ \end{bmatrix} \hspace{1cm} C = \begin{bmatrix} 25 & 22 \\ 31 & 19 \\ \end{bmatrix} \end{equation*}\]
What is the value in:
Transpose \(B\) into \(B^\prime\) using the following blank matrix. \[\begin{equation*} B^\prime = \begin{bmatrix} & & & &\\ & & & &\\ & & & &\\ & & & &\\ \end{bmatrix} \end{equation*}\]
Solve \(D\) where \(C \times B = D\) using the following blank matrix. \[\begin{equation*} D = \begin{bmatrix} & & & & & &\\ & & & & & &\\ & & & & & &\\ & & & & & &\\ \end{bmatrix} \end{equation*}\]
Solve \(C^{-1}\), showing your workings using the appropriate formula. \[\begin{equation*} C^{-1} = \frac{\:}{\hspace{2.5cm}} \begin{bmatrix} & & & & \\ & & & & \\ \end{bmatrix} \hspace{2.5mm}=\hspace{2.5mm} \begin{bmatrix} & & & & \\ & & & & \\ \end{bmatrix} \end{equation*}\]
Homework for Week 4
- There is no separate reading for the seminar in Week 4
- Work through the Week 4 “Methods, Methods, Methods” Section.
- Work through this week’s flashcards to familiarise yourself with the relevant R functions.
- Find an example for each NEW function and apply it in R to ensure it works
- Complete the Week 3 Moodle Quiz
- Familiarise yourself further with matrices by setting yourself two sample matrices, A and B (each should be a 2x2 matrix). Conduct the following operations:
- Multiply A and B
- Invert A and B
- Transpose A and B
- Multiply A with an Identity Matrix
- Multiply A with A\(^{-1}\). What is the result called?
You can check your solutions with https://matrixcalc.org/en/. This is a great way to practice working with matrices until you are familiar with the procedure.
Some of the content of this worksheet is taken from Reiche (forthcoming).↩︎