1. Suppose you work for a social media company. The social media company is trying to predict the number of clicks that different types of advertisements will get on their website. You run the following regression to try to the number of clicks that a particular advertisement will get: \[\begin{align*} Clicks = \beta_0 + \beta_1 FontSize + \beta_2 Picture + U \end{align*}\] where \(Clicks\) is the number of clicks that an ad gets (in thousands), \(FontSize\) is the size of the font of the ad, and \(Picture\) is a binary variable that is equal to one if the ad contains a picture and 0 otherwise.

    1. Suppose you estimate this model and estimate that \(\hat{\beta}_0 = 40\), \(\hat{\beta}_1 = 2\), and \(\hat{\beta}_2 = 80\). What would you predict that the number of clicks would be for an ad with 16 point font size and that contains a picture?

    2. Your boss is very happy with your work, but suggests making the model more complicated. Your boss suggests you run the following regression

      \[\begin{align*} Revenue = \beta_0 &+ \beta_1 FontSize + \beta_2 Picture + \beta_3 Animated \\ &+ \beta_4 ColorfulFont + \beta_5 FontSize^2 + U \end{align*}\] (here \(Animated\) is a binary variable that is equal to one if the ad contains an animation and is equal to 0 otherwise; and \(ColorfulFont\) is a binary variable that is equal to 1 if the font in the ad is any color besides black and 0 otherwise). You estimate the model and notice that

      model from part (a) model from part (b)
      \(R^2\) 0.11 0.37
      Adj. \(R^2\) 0.10 0.35
      AIC 6789 4999
      BIC 6536 4876

      Based on the table, which model do you prefer for predicting ad clicks?

    3. An alternative approach to choosing between these two models is to use J-fold cross-validation. Explain how you could use J-fold cross validation in this problem.



  1. Questions about causal inference.

    1. What does the condition \((Y(1), Y(0)) \perp D\) mean? When would you expect it to hold?

    2. What does the condition \((Y(1), Y(0)) \perp D | (X_1, X_2)\) mean? How is this different from the previous condition?

    3. Suppose you are interested interested in the effect of a state policy that decreases the minimum legal drinking age from 21 to 18 on the number of traffic fatalities in a state. Do you think that the condition in part (a) is likely to hold here? Explain. What variables would you need to include in the condition in part (b) to hold? Explain.



  1. Extra Questions 8.8



  1. Consider the following regression, where child_fincome is child’s family income, parent_fincome is parents’ family income, sex is binary variable indicating whether a child is male, yearborn is the year that the child was born in, and education is the years of education of the child.

    load("../Detailed Course Notes/data/intergenerational_mobility.RData")
    
    reg2 <- lm(log(child_fincome) ~ log(parent_fincome) + sex + yearborn + education,
               data=intergenerational_mobility)
    summary(reg2)
    ## 
    ## Call:
    ## lm(formula = log(child_fincome) ~ log(parent_fincome) + sex + 
    ##     yearborn + education, data = intergenerational_mobility)
    ## 
    ## Residuals:
    ##      Min       1Q   Median       3Q      Max 
    ## -3.11404 -0.32489  0.04514  0.36940  2.70867 
    ## 
    ## Coefficients:
    ##                       Estimate Std. Error t value Pr(>|t|)    
    ## (Intercept)         21.3037430  1.9719502  10.803  < 2e-16 ***
    ## log(parent_fincome)  0.5964735  0.0198679  30.022  < 2e-16 ***
    ## sex                  0.0318506  0.0194484   1.638 0.101572    
    ## yearborn            -0.0085957  0.0009896  -8.686  < 2e-16 ***
    ## education            0.0012618  0.0003437   3.672 0.000244 ***
    ## ---
    ## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
    ## 
    ## Residual standard error: 0.5834 on 3625 degrees of freedom
    ## Multiple R-squared:  0.2221, Adjusted R-squared:  0.2212 
    ## F-statistic: 258.8 on 4 and 3625 DF,  p-value: < 2.2e-16

    How do you interpret the coefficient on log(parent_fincome) in this model?



  1. Consider the following regression using country-level data, where \(GDP\) is a country’s GDP, \(Inflation\) is the country’s current inflation rate, \(Europe\) is a binary variable indicating whether the country is located in Europe, and where \(Democracy\) is a binary variable indicating whether a country has democratic institutions.

    \[GDP = \beta_0 + \beta_1 Inflation + \beta_2 Inflation \cdot Europe + \beta_3 Inflation^2 + \beta_4 Democracy + U\]

    1. What is the partial effect of Inflation in this model?

    2. What is the average partial effect of Inflation in this model?

    3. Given relevant data, how would you estimate the average partial effect of Inflation?