Final Exam Review Notes

Note: All notes from pages 60-127 are included in this document.

Chapter 1 - Omitted Variables and R-squared

  • Remember MLR/Gauss-Markov assumptions:
    • Linear Parameters (MLR1)
    • Random Samples (MLR2)
    • No perfect co-linearity (MLR3)
    • No correlation for all unobserved factors (MLR4)
      • \(E(u|X_n) = 0\)
      • MLR 4 will fail many times
    • Homoskedasticity
      • \(\textit{Var}(u|X_n) = \sigma^2\)
      • MLR5 will also fail many times
  • Generally make the assumption \(E(\beta_j) = \beta_j\)
    • The expected value of \(\beta_j\) is the acutal value, i.e., our error term u is 0.
  • How can we determine omitted variable bias?

True Model

  • Population Model that we assume MLR 1-5 hold true.

\[Y = \beta_0 + \beta_1X_1 + \beta_2X_2+\beta_3X_3 +u\]

  • We can run a restricted model that omits the variable we think is biased. For example, assume \(X_2\) is our omitted variable:

True Model: \[Y = \beta_0 + \beta_1X_1 + \beta_2X_2+\beta_3X_3 +u\] Restricted Model: \[Y = \gamma_0 + \gamma_1X_1 + \textit{omitted}+\gamma_3X_3 +\theta\]

The coefficient and error term symbol changes since our beta estimates change when we omit \(X_2\).

  • The bias is found in the difference between \(\beta_1\) and \(\gamma_1\) or \(\beta_3\) and \(\gamma_3\)
    • \(\gamma_1\) or \(\gamma_3\) is the biased estimator.

Bias Formula

\[E(\hat{Y}) = \beta_1 +\beta_2\times\frac{\textit{covariance}(X_1,X_2)}{\textit{variance}(X_1)}\] Where \(\beta_2 \times\frac{covariance(X_1,X_2)}{variance(X_1)}\) is the bias term.

  • The signs of \(\beta_2\) and the covariance ‘sign’ the bias:
    • What’s the correlation between the omitted variable and the dependent variable?
    • What’s the correlation between the omitted variable and the other independent variable of interest?
    • Positive signage \(\rightarrow\) upward bias
    • Negative signage \(\rightarrow\) downward bias
    • 0 \(\rightarrow\) no bias
  • We can also use an auxiliary model to sign the bias:

True Model:

\[Y = \beta_0 + \beta_1X_1 + \beta_2X_2+\beta_3X_3 +u\]

Restricted Model: \[Y = \gamma_0 + \gamma_1X_1 + \textit{omitted}+\gamma_3X_3 +\theta\]

Auxiliary Model:

\[X_2 = \delta_0 + \delta_1X_1 + \delta_3X_3 + \tau\]

  • When we ‘plug’ the Auxiliary model into the ‘true’ model, we derive the formula for signing the bias:

\[Y = \beta_0 + \beta_1X_1 + \beta_2(\delta_0 + \delta_1X_1 + \delta_3X_3 + \tau)+\beta_3X_3 +u\]

\[Y=\beta_0 +\beta_1X_1 + \beta_2\delta_0 + \beta_2\delta_1X_1 + \beta_2\delta_3X_3 + \beta_2\tau + \beta_3X_3 +u\]

  • Grouping terms based on the position of the \(\delta\) and \(\gamma\) coefficient:

\[Y = (\beta_0 + \beta_2\delta_0) + (\beta_1X_1+\beta_2\delta_1X_1) + (\beta_2X_3\delta_3+\beta_3X_3)+(\beta_2\tau + u)\]

Using the auxiliary model, we assume:

  • \((\beta_0 + \beta_2\delta_0) = \gamma_0\)
  • \((\beta_1X_1+\beta_2\delta_1X_1) = \gamma_1X_1\)
  • \((\beta_2X_3\delta_3+\beta_3X_3) = \gamma_3X_3\)
  • \((\beta_2\tau + u) = \theta\)

R-squared

\(R^2\) explains variation in data \(\rightarrow\) Our independent variables can explain \(100\times R^2\) percent of the variation in the dependent variable.

\(R^2\) Formulae:

\[R^2 =\frac{\sum{(\hat{y}-\bar{y})^2}}{\sum{({y}-\bar{y})^2}} = \frac{\textit{sum of square errors }}{\textit{sum of square totals }} = \frac{SSE}{SST}\]

\[R^2 = 1 - \frac{SSR}{SST} =1- \frac{\textit{sum of square residuals}}{\textit{sum of square totals }} = 1-\frac{\sum({y-\hat{y})^2}}{\sum{({y}-\bar{y})^2}}\]

  • With Multi Linear Relationships (MLR), we cannot assume \(R^2 = r^2\) due to the relationship between \(X_1\) and \(X_2\)

  • \(R^2\) increases as we add more independent variables

    • Cannot trust \(R^2\) as sole indicator of a ‘good’ model
    • Use adjusted \(R^2\) (\(\bar{R^2}\)) as better indicator of ‘good’ model
      • \(\bar{R^2} = 1 - \frac{SSR}{n-k-1} \times\frac{n-1}{SST}\)
        • n is sample size, k is number of variables
  • Four things to realize about \(R^2\):

    • A high \(R^2\) does not satisfy conclusions
    • A high \(R^2\) does not imply ‘correct’ functional form
    • A high \(R^2\) does not imply a casual relationship
    • A high \(R^2\) does not mean you have the correct variables

Chapter 2 - The Standard Error

  • Standard error is similar to standard deviation
    • Remember, standard error (\(se\)) is for sample, standard deviation (\(S^x\)) is for population
  • \(se = \sqrt{\frac{\hat{\sigma}^2}{SST_j \times(1-R^2_j)}}\)
    • \(\hat{\sigma^2} = \frac{SSR}{n-k-1} = \frac{\sum(y-\hat{y})^2}{n-k-1}\)
      • SSR is \(\hat{u^2}\)
    • We want to minimize SSR for a lower standard error
    • We get \(R^2_j\) and \(SST_j\) by regressing our independent variable of interest on all other independent variables
      • \(x_j = \delta_0 + \delta_1X_1 + \delta_2X_2+...\delta_nX_n\)
  • A high \(R^2_j\) can be interpreted as high co-linearity (independent variables affecting the independent variable of interest)
    • A high co-linearity between two independent variables can and will result in a high standard error for your coefficients (this is bad)
    • High co-linearity \(\ne\) perfect colinearity
  • Standard error can decrease

Chapter 3 - Hypothesis Testing

  • Hypothesis tests are tests of likelihoods
    • We can use different distributions to get a probability of likelihood reflected in a test statistic
      • Common distributions: z distribution (normal distribution), t distribution, \(\chi^2\), F distribution
      • Note: when n > ~120; the t distribution is equivalent to the z distribution.
  • When we know population standard deviation, use z-score ( and thus normal distribution)
  • When we do not know population standard deviation, use t-score (slightly normal distribution)
    • Degrees of Freedom (df) is \(n-1\)
    • Use t-table

\[z= \frac{\hat{\beta_n} - \beta_n}{\textit{standard deviation}(\beta_n)} = \frac{\textit{predicted} - \textit{actual}}{\textit{standard deviation}(\beta_n)}\]

\[t= \frac{\hat{\beta_n} - \beta_n}{\textit{standard error}(\beta_n)} = \frac{\textit{predicted} - \textit{actual}}{\textit{standard error}(\beta_n)}\] IMPORTANT: Need MLR6 (error terms are normally distributed) to conduct inference test on \(\beta_n\) (estimates), but not means.

  • Different hypotheses for:
    • \(H_0\) - null hypothesis
      • What we assume
      • can be single parameter (t-test), or multi-parameter (F-test)
      • Ex: \(H_0: \beta_1 = \beta_2\)
    • \(H_{alt}\) - alternative hypothesis
      • What we are looking for
      • The negation of \(H_0\)
        • Ex: \(H_{alt}: \beta_1 \ne \beta_2\)
  • There are different hypothesis test statistics for different statistical purposes:
    • z-test/t-test
      • Single parameter test for means or some value of x
      • Can be one-tailed or two-tailed
      • One-tailed indicates a direction; rarely used since we generally don’t assume we know the direction
        • \(H_0: \beta_1 > x; H_{alt}: \beta_1 < x\)
      • Two-tailed does not have direction; only looks for distance from critical test statistic value (z-crit,t-crit, F-crit, etc.)
        • \(H_0: \beta_1 = x; H_{alt}: \beta_1 \ne x\)
      • Common Critical Values(assuming \(n \rightarrow \infty\))
        • z and t Tests (two-tailed)
          • 90 percent confidence level: 1.645
          • 95 percent confidence level: 1.96
          • 99 percent confidence level: 2.58
        • F Test (\(df_n = 2\))
          • 90 percent confidence level: 2.3
          • 95 percent confidence level: 3
          • 99 percent confidence level: 4.61
        • \(\chi^2\) Test (\(df = 3\))
          • 90 percent confidence level: 6.25
          • 95 percent confidence level: 7.81
          • 99 percent confidence level: 11.34
      • Generally want to calculate a test statistic that is greater than the above values to reject \(H_0\)
        • This is not always what we want though…
    • F test
      • Joint test of significance
        • Tests whether the variables of interest affect the variation of the dependent value
      • Can be multi-parameter (ex: \(H_0: \beta_1 = 0 \cap \beta_2 = 10\))
        • Note: when an F-test only as a single parameter, the F-stat calculated is the square of the equivalent t-stat (\(t_{stat} = \sqrt{F_{stat}}\))
      • Null hypothesis is always and; i.e., all restrictions in \(H_0\) must be true .
      • The alternative hypothesis is XOR, at least one restriction in \(H_0\) must fail in order to reject \(H_0\)
        • \(H_{alt}:\beta_1 \ne 0 \cup \beta_2 \ne 10\)
      • When number of restrictions is equal to number of variables (\(q=k\)) and the restrictions all test for any effect (\(\beta_n =0\)), this is an overall F-test
      • Cannot indicate direction in F-test,
      • Can only test linear relationships (constant slope)
      • The more restrictions, the worse our restricted model gets
      • F-tests are always negative
      • Conducting an F-test
        • Sum of Square Totals for unrestricted and restricted model must be equal to conduct an F-test
        • \[F = \frac{\frac{SSR_{restricted} - SSR_{unrestricted}}{q}}{\frac{SSR_{unrestricted}}{n-k-1}}\]
          • Where q is the number of restrictions (count the number of equal signs in \(H_0\)), n is the number of observations, and k is the number of variables in the unrestricted model.
          • You can also used the \(R^2\) formula to calculate an F-stat:
            • \(F = \frac{\frac{R^2_{unrestricted} -R^2_{restricted}}{q}}{\frac{1-R^2_{unrestricted}}{n-k-1}}\)
            • Note: You cannot use \(\bar{R^2}\) to calculate an F-stat
      • Chow Test is a version of the F-test
        • tests whether two groups should be regressed together or separately
          • \(H_0: \beta_0 = \gamma_0 \cap \beta_1 =\gamma_1 \cap\beta_n = \gamma_n \rightarrow\) the slopes and intercepts of the two groups are the same
          • \(H_{alt}: \beta_0 \ne \gamma_0 \cup \beta_1 \ne\gamma_1 \cup\beta_n \ne \gamma_n \rightarrow\) the slopes and intercepts of the two groups are not the same
        • Uses different F-stat formula:
          • \(F = \frac{SSR_{pooled}- (SSR_1 + SSR_2)}{(SSR_1 + SSR_2)} \times\frac{n-2(k+1)}{k+1}\)
        • Need at least one indicator variable to conduct a Chow test
        • Pooled model, model for group 1, and model for group 2 do not include the indicator variable
        • Can also use a fully-interacted model
          • Model where all independent variables are multiplied by the indicator variable and includes the indicator variable of interest in the model
            • \(Y = \beta_0 + \beta_1X_1 + \beta_2X_2 +\beta_3X_3+\beta_4[indicator]+\beta_5X_1\times[indicator]+...+\beta_nX_n\times[indicator]\)
    • \(\chi^2\) tests
      • Can test association and independence of two variable groups
      • Not really covered in Quant II, but the \(\chi^2\) distribution is necessary for our logit and probit model later on,tests for heteroskedasticity, and test like ANOVA (Analysis of Variance).

Chapter 4 - Indicators & Interaction Terms

  • We can manipulate data to make \(\beta_n\) represent some difference or contrast
  • Indicators are variables that take on a binary value of either 0 or 1
    • It is good practice to name an indicator variable after the category coded “1”
  • The category that is coded “0” is the omitted/baseline category
    • In a regression without indicators, \(\beta_0\) is just the estimated average value
    • In a regression with indicators, \(\beta_0\) is the estimate for the baseline category.
    • The coefficient on the indicator represents the difference between the omitted category and the included category.
    • Ex: take the regression line \(BWGHT = \beta_0 + \beta_1male + \beta_2cigs +u\); where male is an indicator and cigs is interval ratio.
      • When male = 1: \(BWGHT = \beta_0 + \beta_1(1) + \beta_2cigs = (\beta_0 +\beta_1)+\beta_2cigs \rightarrow\) the intercept shifts by \(\beta_1\).
      • When male = 0: \(BWGHT = \beta_0 + \beta_1(0) + \beta_2cigs = \beta_0 +\beta_2cigs \rightarrow\) the intercept remains the same.
      • \(\therefore\) the difference in average BWGHT based on gender is \(\beta_1\).
      • Note: We are assuming that the slope is the same between the two groups.
  • We can also use multiple categories (multiple indicator variables) to observe difference between groups adjacent to each other
    • See March 12 lesson on indicators
    • We would use an F-test for hypothesis testing if our categories are mutually exclusive, and a t test for overlapping categories
  • Interaction Terms are used when we want to test if one independent variable is affected by another in the regression.
    • Prior assumptions were that all the independent variables are not affected by other variables in the regression
      • This is rarely the case in the ‘real world’
  • There are three types of interaction terms:
    • Indicator-Indicator
      • \(Y = \beta_0 +\beta_1educ +\beta_2linkedin +\beta_3male +\beta_4male\times linkedin +u\); where male and linkedin are indicator variables
      • This interaction terms gives us the joint effect of being male and having a Linkedin account, otherwise the difference between the two groups (\(male, \neg male, linkedin, \neg linkedin\))
    • Indicator-Interval Ratio
      • \(Y = \beta_0 +\beta_1educ +\beta_2linkedin +\beta_3male +\beta_4male\times educ +u\); where male and educ are the indicator and interval ratio variable, respectively.
      • This interaction terms gives us the difference in slope between groups, in this case male and female.
    • Interval Ratio - Interval Ratio
      • Gives us the effect of one continuous variable on another continuous variable with respect to the level of the variable you are interpreting
      • \(Y = \beta_0 + \beta_1motheduc + \beta_2fatheduc + \beta_3(mothereduc \times fatheduc)\), where motheduc and fatheduc are both continuous variables.
      • Can be interpreted by holding one variable constant, and then observing the change in the dependent variable when we increase variable of interest by one unit.
      • Convenient to use margin command in Stata

Chapter 5 - Functional Forms and Ramsey’s RESET Test

  • Remember that:

\[\hat{\beta} = \frac{\sum{(x-\bar{x})(y-\bar{y})}}{\sum (x -\bar{x})^2} = \frac{covariance(x,y)}{variance(x)}\]

  • For bivariate, or Simple Linear Regressions (SLR) data, \(R^2 = r^2\). In other words, our correlation coefficient squared is our R-squared that explains the variation in our dependent variable that can be attributed to our independent variable.

  • Linear Approximations don’t always work, and thus require changing the functional form of our model.

Log Functional Forms

Log-Level:

\[\log(y) = \beta_0 + \beta_1X_1 + \beta_2X_2+...\beta_nX_n+u\]

  • Coefficients should be interpreted as: “For each additional unit of X, Y changes by \(\beta_n \times 100\) percent.

Level-Log:

\[y = \beta_0 + \beta_1\log(X_1) + \beta_2X_2+...\beta_nX_n+u\]

  • Coefficients should be interpreted as: “For each additional unit of X, Y changes by \(\frac{\beta_n}{100}\) percent.

    • Note that the additional coefficient (\(\beta_2\)) would be interpreted as normal since it is not in a log functional form.
  • Log-Log does not require a transformation, the coefficients would be interpreted as percentage point changes.

  • How do we know if our functional form is correct?

    • Using linear terms to estimate a non-linear relationship
      • Major reason why we include squared terms and \(\log\) terms.
    • Not correcting for skewness in our independent or dependent variables
  • Interpreting coefficients of log and quadratics/cubic/nth power variables gets tricky quickly.

    • Quadratics must be interpreted with their 1st power variable (that is always included in regression) when holding other variables fixed
      • Example - \(Y = \beta_0 + \beta_1X_1 + \beta_2X_1^2 + \beta_3X_2 +u\)
        • This stems from the general form of a quadratic model: \(y = ax^2+bx+c\)
        • Can’t hold \(X_1\) fixed to interpret \(\beta_2\)
      • \(x^* = |\frac{\beta_1}{2\times\beta_2}| \rightarrow\) turning point (inflection point) when rate of change ‘flips’.
        • This ratio comes from taking the first-order derivative of the regression line with respect to the variable of interest, then setting the derivative equal to 0, and solving for the slope.
        • \(\Delta Y = \beta_1\Delta X_1 + \beta_2\Delta X_1^2\)
  • Often want a model with the simplest form

    • OLS assumptions still need to be met
    • Can’t compare two different functional forms
  • How can we test if our functional form is correct?

    • Check \(\bar{R^2}\) between two similar functional forms and choose the highest one
    • Ramsey’s RESET test
      • Uses coefficients of nth power of estimated dependents variables regressed on 1st power dependent variable (in addition to independent variables).
        • \(Y=\beta_0+\beta_1X_1+\beta_2X_2+\beta_3X_3 + \delta_1\hat{y}^2 + \delta_2\hat{y}^3+\delta_3\hat{y}^4\)
        • powers of predicted dependent variable is dependent on software used, often goes to 4th power
      • Sidenote: Utilizes properties of a Taylor Series
      • \(H_0:\) all coefficients of the nth power dependent variables equal 0, \(H_{alt}\): at least one of the coefficients does not equal zero
        • Using model above: \(H_0:\delta_1 = \delta_2 = \delta_3 = 0; H_{alt}: \delta_1 \ne 0 \cup \delta_2 \ne 0 \cup \delta_3 \ne 0\)
        • One of few cases where we want to fail to reject \(H_0\) using an F-test.

Chapter 6 - Heteroskedasticity

  • Heteroskedasticity is the non-constant variation (spread) in our error term
    • The residuals are a function; think of the residual plot looking like a function of \(x^2\) (non-constant slope).
    • Violation of MLR5
      • \(Var(u|X_n) = \sigma^2\)
    • If heteroskedasticity is suspected, we cannot conduct inference tests
      • Standard errors are negatively impacted by heteroskedasticity
  • How can we test for heteroskedasticity?
    • Eyeball the residual plot
    • White test in Stata (estat imtest, white)
      • can also regress squared residuals on independent variables
    • Breush-Pagan test
      • Uses Langrange Multipler test statistic (LM-stat) and the \(\chi^2\) distribution
      • \(H_0: Var(u|X_n) = \sigma^2; H_{alt}: Var(u|X_n) \ne \sigma^2\)
      • \(LM_{stat} = n \times R^2_\hat{u^2}\); where \(R^2_\hat{u^2}\) is the \(R^2\) of the squared residuals.
      • Use a \(\chi^2\) table to determine whether to reject or fail to reject \(H_0\).
  • How can we ‘fix’ heteroskedasticity?
    • Use robust command in Stata if \(n \ge 150\)
    • Change the functional form if we suspect that the functional form is causing heteroskedasticity.
    • If we know the form of the heteroskedasticity, we can use weighted least squares -\(\frac{y}{\sqrt{h_i(x)}} = \frac{\beta_0}{\sqrt{h_i(x)}}+\beta_1\frac{X_1}{\sqrt{h_i(x)}} +\beta_2\frac{X_2}{\sqrt{h_i(x)}} +...+\beta_n\frac{X_n}{\sqrt{h_i(x)}}\)
      • Note: It is very rare that we know the exact form of the heteroskedasticity

Chapter 7 - Probit, Logit, and Linear Probability Models (LPM)

  • We can use OLS to estimate predictions by modifying our dependent variable to be a binary between 0 and 1
    • The probability of success being equal to 1
    • \(P(Y=1|X_n) = \beta_0 + \beta_1X_1 + \beta_2X_2+...+\beta_nX_n +u\)
  • There are two big issues with an LPM
    • Out of bounds probabilities
      • LPMs are constant slope, and can go past 0 (negative probabilites) and past 1 (greater than the absolute probability of success)
    • Heteroskedasticity
      • LPMs are susceptible to heteroskedasticity
  • We can use two different models that ‘fix’ the issues with an LPM
    • Logit
      • Uses logistical Cumulative Distribution Function to bound probabilities between 0 and 1, inclusive
        • \(F(z) = \frac{1}{1+e^{-z}}\); where z is your regression line
        • \(P(Y=1|X_n) = F(z)\)
        • Provides us a z-score which in turn gives us a probability at the given levels of the independent variables.
        • Can use Odds Ratio (\(\log(\frac{p}{1-p})\)) to interpret coefficients on independent variables
          • \(\log(\frac{p}{1-p}) = z \rightarrow e^{(\log(\frac{p}{1-p}))} = e^z \rightarrow \frac{p}{1-p} = e^z\)
            • Holding other variables fixed, you can interpret the coefficient on a variable of interest as the change in the odds of the probability of success by \(e^{\beta_n}\).
            • Due to nature of the math, an Odds Ratio confidence interval is not significant if 1 is included in the interval
    • Probit
      • Uses \(\phi\) CDF
      • Like logit, also gives us a predicted z-score and thus a probability for our fixed level of independent variables
        • \(P(Y= 1|X_n) = \phi(z)\)
      • Cannot easily interpret coefficients without using Stata’s margins command
      • Must be specific in interpreting coefficients; mention level or value of each variable when saying “holding variables fixed”
  • We can use \(\chi^2\) distribution and the Log-Likelihood Ratio in place of F-test:
    • \(LR_{stat} = -2(LL_{restricted} - LL_{unrestricted})\)
    • \(H_0\), \(H_{alt}\) similar to F-test.
    • In Stata:
      • probit [unrestricted regression]
      • estimates store [new variable name for unrestricted ]
      • probit [restricted regression]
      • estimates store [new variable name for restricted]
      • lrtest [new variable name for unrestricted] [new variable name for restricted], stats
  • Pseudo R-squared (\(\rho^2\))
    • Used because regular \(R^2\) cannot be applied to probit nor logit
      • \(\rho^2 = \frac{LL(B)}{LL(0)} = \frac{\textit{log-likelihood of restricted model}}{\textit{log likelihood of unrestricted model}}\)
    • Not an important measure with respect to explaining variation
    • Ideal to have \(.2 \le \rho^2 \le .4\)

Chapter 8 - Measurement Error

  • When a particular variable is consistently off and it is not random
    • Can be caused by rounding errors
    • \(y = y^* +\epsilon\), where \(\epsilon\) represents the measurement error and \(E(\epsilon|X_n) = 0\)
  • We do not want \(\epsilon\) correlated with independent variables of interest
    • Want our \(\beta_n\) estimates to be accurate
    • Standard errors to be smaller
    • \(R^2\) to explain good amount of variation
  • If our positive and negative measurements errors do not cancel out, we have a biased intercept.
  • A measurement error in our independent variables is bad
    • Measurement error in dependent variable isn’t as bad as in independent variables
    • Measurement error in our independent variables lead to:
      • Biased \(\beta_n\) (attenuation bias)
        • Our regression line gets flatter
        • Direction of bias can be upward or downward
      • Reduces \(R^2\)
      • May increase or decrease standard errors