Beruflich Dokumente
Kultur Dokumente
𝑛 2
𝑖=1𝑋𝑖 − 𝑋
𝑠𝑋2 = ; 𝑠𝑋 = 𝑠𝑋2
(𝑛 − 1)
Sample covariance and sample SD
Correlation Analysis
• Calculating and interpreting the correlation
coefficient:
• Sample correlation coefficient:
𝑐𝑜𝑣(𝑋, 𝑌)
1 : 𝑟= =
𝑠𝑋 𝑠𝑌
𝑛
𝑖=1 𝑋𝑖 − 𝑋 𝑌𝑖 − 𝑌
=
𝑛 2 𝑛 2
𝑖=1 𝑋𝑖 − 𝑋 𝑖=1 𝑌𝑖 − 𝑌
Sample correlation coefficient
Correlation Analysis
• Calculating and interpreting the correlation
coefficient:
• A measure of linear association
• No unit of measurement attached
Testing the significance of the correlation
coefficient
• Significance tests allow us to assess whether
apparent relationships between random
variables are the result of chance.
• Is the estimate of 0.8704 significantly different
from 0?
Testing the significance of the correlation
coefficient
• Assumptions: Both of the variables are normally
distributed
• Null hypothesis: the correlation in the population
is 0.
• Alternative hypothesis: the correlation in the
population is different from 0.
• The following test statistics is used:
𝒓 𝒏−𝟐
𝒕= ~𝒕(𝒏 − 𝟐)
𝟏 − 𝒓𝟐
Perform significance test
𝒓 𝒏−𝟐
𝒕= = 𝟑. 𝟓𝟑𝟔
𝟏 − 𝒓𝟐
Visualize the t-test
Perform significance test in R
Linear regression with one independent
variable:
𝒀𝒊 = 𝜷𝟏 + 𝜷𝟐 𝑿𝒊 + 𝒖𝒊
𝒀𝒊 = 𝜷𝟏 + 𝜷𝟐 𝑿𝒊 + 𝒆𝒊
Ordinary Least Squares (OLS)
• The values of 𝛽1 and 𝛽2 minimize the following
function: 𝑛
2
𝑌𝑖 − 𝛽1 − 𝛽2 𝑋2
𝑖=1
Ordinary Least Squares (OLS)
𝒏
𝒊=𝟏 𝑿𝒊 − 𝑿 𝒀𝒊 − 𝒀
𝜷𝟐 = 𝟐
𝒏
𝒊=𝟏 𝑿𝒊 − 𝑿
𝜷𝟏 = 𝒀 − 𝜷𝟐 𝑿
OLS: An illustrative example
OLS: Fitted values and Residuals
OLS Assumptions
𝝈
𝑺𝑬 𝜷𝟐 =
𝒏 𝟐
𝒊=𝟏 𝑿𝒊 − 𝑿
𝒏 𝟐
𝒆
𝒊=𝟏 𝒊
𝝈𝟐 =
𝒏−𝟐
Precision or standard errors of OLS
estimates
𝝈
𝑺𝑬 𝜷𝟐 = =
𝒏 𝟐
𝒊=𝟏 𝑿𝒊 − 𝑿
𝑛 2
𝑒
𝑖=1 𝑖
= 2
𝑛
𝑛−2 𝑖=1 𝑋𝑖 −𝑋
Precision or standard errors of OLS
estimates
𝒏 𝟐
𝑿
𝒊=𝟏 𝒊
𝑺𝑬 𝜷𝟏 = 𝟐
𝝈=
𝒏
𝒏 𝒊=𝟏 𝑿𝒊 − 𝑿
𝑛 2 𝑛 2
𝑋
𝑖=1 𝑖 𝑒
𝑖=1 𝑖
= 2
𝑛
𝑛 𝑛 − 2 𝑖=1 𝑋𝑖 − 𝑋
Precision or standard errors of OLS
estimates: An illustrative example
Gauss-Markov Theorem