4. (Data exercise: heteroskedasticity) For this question, use the data gpa.dta. We also provide the Stata code ps4-hr. do for your reference. (Please feel free to write your own code if you wish.) We are interested in the factors determining college GPA. The data contain the following variables: colgpa is college GPA, hsgpa is high school GPA, act is college entrance exam score, skipped denotes the total number of lectures missed during the semester, and \( p c \) is a dummy variable with a value of 1 if the student owns a personal computer and 0 otherwise.
(a) Use OLS to estimate the model:
\[
\text { colgpa }_{i}=\beta_{0}+\beta_{1} \text { hsgpa }_{i}+\beta_{2} \text { act }_{i}+\beta_{3} \text { skipped }_{i}+\beta_{4} p c+u_{i} .
\]
Obtain the OLS residuals.
(b) We want to estimate the model using WLS. Estimate the weights by regressing \( \log \left(\hat{u}_{i}^{2}\right) \) on all independent variables. Get the fitted value \( \hat{g}_{i} \), and \( \hat{h}_{i}=\exp \left(\hat{g}_{i}\right) \). Then use \( \hat{h}_{i} \) as the weight.
(c) In the WLS estimation in the last question, obtain heteroskedasticity-robust standard errors. In other words, allow for the fact that the variance function estimated might be mis-specified. Do the standard errors change much?
(d) Finally, estimate the model using OLS and report the heteroskedasticity-robust standard errors. We want to test the null hypothesis \( \beta_{4}=0 \) against the alternative \( \beta_{4} \neq 0 \). Can you reject the null hypothesis at the \( 5 \% \) significance level using 1) OLS estimator with robust standard error 2) WLS estimator using conventional standard error and 3) WLS estimator using robust standard error?