Computer Exercises
1. **Problem C2.1 (Data file: 401K.dta):**
(i) Find the average participation rate ($\overline{prate}$) and average match rate ($\overline{mrate}$).
(ii) Estimate the simple linear regression:
$$prate = \hat{\beta}_0 + \hat{\beta}_1 mrate$$
Report regression coefficients, sample size ($n$), and $R^2$.
(iii) Interpret the intercept $\hat{\beta}_0$ and slope $\hat{\beta}_1$.
(iv) Predict $prate$ when $mrate = 3.5$ using regression equation and assess reasonableness.
(v) Evaluate how much variation in $prate$ is explained by $mrate$ using $R^2$.
---
2. **Problem C2.2 (Data file: CEOSAL2.dta):**
(i) Find average salary ($\overline{salary}$) and average tenure ($\overline{ceoten}$).
(ii) Count CEOs with tenure = 0 and find max tenure.
(iii) Estimate regression:
$$ \log(salary) = \beta_0 + \beta_1 ceoten + u $$
Report coefficients, sample size, $R^2$. Find approximate predicted percentage change in salary per 1 year increase in tenure.
---
### Solutions (conceptual, data needed to compute actual numbers):
1. C2.1
1. Compute sample means:
$$ \overline{prate} = \frac{1}{n} \sum_{i=1}^n prate_i, \quad \overline{mrate} = \frac{1}{n} \sum_{i=1}^n mrate_i $$
2. Perform OLS regression:
$$ prate_i = \hat{\beta}_0 + \hat{\beta}_1 mrate_i + \hat{u}_i $$
Output includes $\hat{\beta}_0$, $\hat{\beta}_1$, $n$, and $R^2$.
3. Interpretation:
- Intercept $\hat{\beta}_0$ represents average $prate$ when $mrate=0$ (plan with zero matching).
- Slope $\hat{\beta}_1$ shows expected increase in $prate$ per unit increase in $mrate$.
4. Prediction:
$$ \hat{prate} = \hat{\beta}_0 + \hat{\beta}_1 \times 3.5 $$
Assess if prediction is within plausible range (0-100%). If out of range, note model extrapolation limitations.
5. The $R^2$ shows fraction of variance in $prate$ explained by $mrate$; values closer to 1 indicate strong explanatory power.
---
2. C2.2
1. Compute averages:
$$ \overline{salary} = \frac{1}{n} \sum_{i=1}^n salary_i, \quad \overline{ceoten} = \frac{1}{n} \sum_{i=1}^n ceoten_i $$
2. Count CEOs with zero tenure:
$$ \text{count} = \sum_{i=1}^n I(ceoten_i=0) $$
Find max tenure:
$$ \max_{i=1}^n ceoten_i $$
3. Estimate regression:
$$ \log(salary_i) = \hat{\beta}_0 + \hat{\beta}_1 ceoten_i + \hat{u}_i $$
Interpretation:
- $\hat{\beta}_1$ approximately equals the percentage increase in salary for one more year as CEO, since:
$$ \%\Delta salary \approx 100 \times \hat{\beta}_1 $$
---
**Note:** Actual numerical computations require the data files and statistical software.