Download presentation
Presentation is loading. Please wait.
Published byArron Harrington Modified over 9 years ago
1
March 7, 2006Lecture 8aSlide #1 Matrix Algebra, or: Is this torture really necessary?! What for? –Permits compact, intuitive depiction of regression analysis –Flexible, in that it can handle any number of independent variables –Generally used in statistical presentation, for OLS and other techniques You need to be able to interpret it.
2
March 7, 2006Lecture 8aSlide #2 The Basics Matrix form:
3
March 7, 2006Lecture 8aSlide #3 Transpose (“prime”) of a Matrix
4
March 7, 2006Lecture 8aSlide #4 Vectors Vectors are essentially single rows or columns:
5
March 7, 2006Lecture 8aSlide #5 Adding Matrices Addition works only if matrices have the same dimension:
6
March 7, 2006Lecture 8aSlide #6 Multiplication of Matrices Dimensions: A(r*q) * B(q*c) = C(r*c), So the number of columns in the first matrix must match the number of rows in the second matrix
7
March 7, 2006Lecture 8aSlide #7 Rules for Matrix Multiplication Are matrices conformable? A x B = C (r x q) (q x c) (r x c) Vector times a matrix: A x B = C (r x c) (c x 1) (r x 1) Row and column vectors: A x B = C (r x 1) (1 x p) (r x p) A x B = C (1 x r) (r x 1) (1 x 1) a scalar
8
March 7, 2006Lecture 8aSlide #8 Identity Matrices Square matrices with 1’s on diagonal and 0’s elsewhere: Identity matrices act like 1’s in familiar algebra: I x B = B (r x r) (r x c) (r x c) 4 x 4 identity matrix
9
March 7, 2006Lecture 8aSlide #9 Matrix Inversion Acts a bit like division in algebra: any matrix multiplied by its inverse is equal to the identity matrix: The text uses the following example: Inversion works only for square matrices
10
March 7, 2006Lecture 8aSlide #10 Finding the Identity Matrix: An Example 2a + 4b = 0 so 2a = -4b and a = -2b 3a + b = 1 so 3(-2b) + b = 1, and -5b=1 so b = -1/5 Therefore: a = -2(-1/5) so a = 2/5 3c + d = 0 so d = -3c 2c + 4d = 1 so 2c + 4(-3c) = 1 and -10c = 1 so c = -1/10 Therefore d = -3(-1/10) so d = 3/10
11
March 7, 2006Lecture 8aSlide #11 Example Continued Now we can check and see the result of C x C -1 :
12
March 7, 2006Lecture 8aSlide #12 Regression in Matrix Form Assume a model using n observations, with K-1 X i (independent) variables
13
March 7, 2006Lecture 8aSlide #13 Regression in Matrix Form Note: we can’t uniquely define (X’X) if any column in the X matrix is a linear function of any other column(s) in X. Why is that?
14
March 7, 2006Lecture 8aSlide #14 The X’X Matrix Note that you can obtain the basis for all the necessary means, variances and covariances from the (X’X) matrix
15
March 7, 2006Lecture 8aSlide #15 An Example of Matrix Regression Using a sample of 7 observations, where X has Elements {X 0, X 1, X 2, X 3 }
16
March 7, 2006Lecture 8aSlide #16 New Dataset: Scientists Sample of AAAS members –US and EU –Collected in 2002 –Focus on science, security, GCC… Available on the class data page –See the codebook and do file
17
March 7, 2006Lecture 8aSlide #17 Application of Multivariate Regression Analysis Predict expected temperature change (c4_34_tc), using the following independent variables: –Age (c5_3_age) –Gender (c5_4_gen) –Ideology (c4_1_ide)) –Fragile nature (c4_2_nat) –US or EU (recoded: usa_c) Run the model Evaluate the Output Draw Initial Conclusions
18
March 7, 2006Lecture 8aSlide #18 Break for analysis... Feel free to work in groups Discuss Analyses Take 20 minutes
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.