open gpa1.gdt # plain OLS m1 <- ols colGPA const hsGPA ACT skipped PC # OLS with robust std errors m2 <- ols colGPA const hsGPA ACT skipped PC --robust # generate variable for White's regression genr yhat1 = $yhat genr usq1 = $uhat*$uhat genr sqfit = yhat1*yhat1 # White, "special case" ols usq1 const yhat1 sqfit genr vuhat = $yhat*$yhat # manually weighted least squares, 1 genr wi = 1/vuhat m3 <- wls wi colGPA const hsGPA ACT skipped PC # manually weighted least squares, 2 genr wi = 1/sqrt(vuhat) m4 <- wls wi colGPA const hsGPA ACT skipped PC # WLS without and with robust std errs genr colGPAw = colGPA*wi genr cw = const*wi genr hsGPAw = hsGPA*wi genr ACTw = ACT*wi genr skipw = skipped*wi genr PCw = PC*wi m5 <- ols colGPAw cw hsGPAw ACTw skipw PCw m6 <- ols colGPAw cw hsGPAw ACTw skipw PCw --robust # for comparison, gretl's hsk correction m7 <- hsk colGPA const hsGPA ACT skipped PC