270 likes | 407 Views
Quantitative Methods in Social Sciences (E774): Review Session X. Dany Jaimovich November 25, 2009. Plan for today. PP4+A3 Correlations: Theory Review Test for correlations STATA OLS: Theory Review OLS vs Correlation Goodness of fit, Tests STATA. Correlations.
E N D
Quantitative Methods inSocial Sciences (E774): Review Session X Dany Jaimovich November 25, 2009
Plan for today • PP4+A3 • Correlations: • Theory Review • Test for correlations • STATA • OLS: • Theory Review • OLS vs Correlation • Goodness of fit, Tests • STATA
Correlations • The correlation coefficient (r) aims to measure how related are two variables. • There are two main types of correlation coefficients: • Pearson’s-r: Calculate the linearity of a point estimation • Spearman rank correlation
Correlations • Pearson’s-r:
Correlations • Pearson’s-r:
Correlations • Example (from class):
Correlations • Example (from class):
Correlations • Test of significance for a Pearson’s-r: • Null Hypothesis: H0 =rxy=ryx= 0 • A two tails t-test is performed: • If tobtained<ttablethen correlation not significant.
Correlations • STATA: • ttable • pwcorr income unemployment, sig • pwcorr income unemployment, sig star(.05)
Correlations • Spearman Rank Correlation: • correlation coefficient between ranks • D: Difference of rank between paired observations in two variables
Correlations • Spearman Rank:
Correlations • The test of significance is exactly the same t-test that in the case of Pearson’s-r:
Correlations • Spearman Rank: • spearman MIA MDEV
Regressions WARNING!!!
Regressions • Ordinary Least Squares (OLS): Best Linear Unbiased Estimator (BLUE) • Assume a linear relation between (among) the variables:
Regressions • How do OLS works?: The idea is to minimize the distance of the residuals. Particularly, the measure is the square distance of the residuals, so more weight is given to “distant observations” (danger of outliers):
Regressions • The model to be estimated is: • α=intercept • β=slope • ε=residuals (y-ŷ), E(ε)=0, s(ε)=σ
Regressions • From the minimization, the LS estimator for the parameter measuring the linear relations is: • β= • Looks familiar????
Regressions • From the minimization, the LS estimator for the parameter measuring the linear relations is: • β=
Regressions • Then…. What is the difference of correlation and regression????: • Corr (x,y)=Corr(y,x) • OLS (x,y)≠ OLS (y,x)… define dependent variable!!! • Correlation fits co-movements of the variables, regressions estimate a “directional” linear relation • The big difference comes with multivariate regressions…
Regressions • EXAMPLE:
Regressions • EXAMPLE: • reg unemployment income • reg incomeunemployment • predict yhat • predict e, residuals • rvfplot, yline(0) • rvpplot unemployment, yline(0) • avplot unemployment
Regressions • “Goodness of fit” (R²): How much of the variation in the dependent variable is explained by the “regressors”:
Regressions • Significance test: H0: β =0, Ha: β ≠0 • Test statistic: • The obtained t is compared with two-tails test from t-table
Regressions • EXAMPLE:
Regressions • Multivariate regressions: • The slope in X1 now is “conditional” to the effects of X2 • F-test: joint significance • reg income unemployment gov